Urban75 Home About Offline BrixtonBuzz Contact

Today I have mostly been using ${insert development technology here}

Mostly dealing with connecting things. Unity3D into Syphon and then out of Resolume. Me and my students are today creating a life size projection mapped car racing game.. :thumbs:
 
Mostly I've been raving about Qualcomm's a-maz-ing Trepn profiler which in short allows you to check any given app's cpu usage (right down to the core level), memory usage, battery usage to the mw the app is using, and you can export to .csv.
 
Ruby on Rails. I'm really motoring with it now, refactoring away like a mad thing, etc. I really must get my head around testing, though.
 
Our annoying customer wanted their server behind a VPN so all my scripts I used to use have broken. I've taken this opportunity to get into the world of ChatOps :oops:

Got Hubot connected to our HipChat, who starts a python shell and talks to my Python scripts (couldn't be arsed learning Coffeescript just to re-write some scripts*), who then uses Fabric over the VPN to pull shit from the customer's server. It's taken me two days to figure out how it all goes togher but going to free up so much time for me in the future. And it's cool having a robot do shit for you. I've called him Arnie, because he's the task terminator :facepalm:

Gonna hook up some other scripts once I get chance, now that I know how the plumbing works. I also need to get him running remotely as currently he's dependent on my local VPN connection, but I don't want to have to have my computer switched on all the time. Have a free Heroku account that he is set up to run on, but he doesn't do anything useful yet as he can't connect to the VPN.

*Coffeescript actually looks really nice. Like a Pythonised version of JS. I might give this a serious go one day.
 
How easy is it to pick up? How much better is it than php for a database based website?
I don't know php well enough to make a comparison, and it may be that something like Cake is a better comparison. But I am enjoying ruby's oop nature and functional programming capabilities, and the framework feels nice to use. My biggest headache has been learning to debug - errors messages are highly accurate, and comprehensive, but rarely point you directly to the problem!
 
That looks brilliant.

Have you actually made anything yet?
Yeah, it's quite quick and you have all of your asset tools in one window. (You can cut and paste the code from an editor but that's cheating.) More to the point, it's hard to waste time going off on weird fiddly tangents, so you get more done.

Anything good is a different matter.
 
I don't know php well enough to make a comparison, and it may be that something like Cake is a better comparison.

Yeah exactly - The Rails bit is a framework so to be fair should compare Ruby on Rails to PHP + a nice framework. I like Laravel. But I've known a bit of PHP for far too long to do a fair comparison and even all those years ago where Ruby on Rails was the flavour of the month and I hadn't found a nice PHP framework, I couldn't give Ruby on Rails a fair and unbiased chance because there was just too much unfamiliar syntax, jargon, paradigms and design patterns. Since then I believe the bulk of the paradigms, tools and patterns that Ruby on Rails did well have been appropriated by other frameworks.

If I had to use a different server-side language than php I suspect I'd go for node because that is javascript so at least I could stick to the same language on both sides. Depends on the nature of the app though.
 
I've been having some relatively fun times at work gluing various things together...

Specifically, a pretty long chain of tech in order to bypass limitations of selecting right printer & paper tray in a web browser when generating various despatch documents in a factory.

The user interacts with the web-app as normal in their browser. The linux server is running apache/php/mysql and the server-side of the app is written with Laravel.
A C# program that is also running on their computer establishes a secure websocket connection to the server, which is running socket.io and node.js to provide the websocket server.
Laravel has event & broadcasting features. A Redis database is used to bridge between the php/mysql side and the node.js websocket server.
When the user reaches the appropriate stages in the web-app, Laravel is told to broadcast something on the appropriate websocket channel, a channel which is unique to that logged in user & company.
The C# program receives the broadcast on that channel, which includes a URL that it is told to save to a temporary file and then print to the appropriate printer/tray.
When it asks for that URL, Laravel sends a load of data to a linux command line tool which can create a pdf file, and then Laravel sends the resulting pdf file over https to the C# program.
Blah blah etc.

Not ready to go live yet but it's going to save a couple of overworked individuals from one of their hideously repetitive tasks (selecting the tray with a4 paper or the one with some special labels every bloody time) so it's one of those rare things someone will actually properly thank me for when its all up and running.
 
I've been having some relatively fun times at work gluing various things together...

Specifically, a pretty long chain of tech in order to bypass limitations of selecting right printer & paper tray in a web browser when generating various despatch documents in a factory.

The user interacts with the web-app as normal in their browser. The linux server is running apache/php/mysql and the server-side of the app is written with Laravel.
A C# program that is also running on their computer establishes a secure websocket connection to the server, which is running socket.io and node.js to provide the websocket server.
Laravel has event & broadcasting features. A Redis database is used to bridge between the php/mysql side and the node.js websocket server.
When the user reaches the appropriate stages in the web-app, Laravel is told to broadcast something on the appropriate websocket channel, a channel which is unique to that logged in user & company.
The C# program receives the broadcast on that channel, which includes a URL that it is told to save to a temporary file and then print to the appropriate printer/tray.
When it asks for that URL, Laravel sends a load of data to a linux command line tool which can create a pdf file, and then Laravel sends the resulting pdf file over https to the C# program.
Blah blah etc.

Not ready to go live yet but it's going to save a couple of overworked individuals from one of their hideously repetitive tasks (selecting the tray with a4 paper or the one with some special labels every bloody time) so it's one of those rare things someone will actually properly thank me for when its all up and running.
Or you've just taken away someone's hero status :(

Only Guy Who Puts Paper In Copier Considers Himself A Hero
 
I haven't been following the thread (just watched it though,)

elbows can you not create queues for the tray(s) on the web server, write a pdf then exec() to lp to the relevant printer(s)?
 
I'm trying to learn python again. Giving it a proper go. In particular I want to use it for the scapy packet manipulation library and other network stuff. I'm okay writing simple bash scripts and really liking the learn python the hard way online book. The title is deceptive. The author breaks the core stuff down into really simple steps.
 
I haven't been following the thread (just watched it though,)

elbows can you not create queues for the tray(s) on the web server, write a pdf then exec() to lp to the relevant printer(s)?

The webserver is offsite so I'd rather not explore those possibilities, if I've got the right end of the stick for what you are suggesting.
 
The webserver is offsite so I'd rather not explore those possibilities, if I've got the right end of the stick for what you are suggesting.

Yes, I think you have - I'd gone with the in bit of in a factory :)
 
I'm reading a book about Rails 4 testing. It's beginning to look quite interesting, even if it flies in the face of my development practice over 35 years! :)
 
any capistrano users here? I'm struggling with something that should be extremely simple but I can't get it working and it's either difficult to search for and/or the docs on this bit are shite.
 
any capistrano users here? I'm struggling with something that should be extremely simple but I can't get it working and it's either difficult to search for and/or the docs on this bit are shite.
I've fiddled with it, but I'm probably not the nerd you are looking for.
 
I've fiddled with it, but I'm probably not the nerd you are looking for.
Well, in the hope that you know, I'll give you my problem anyway :)

To deploy, we run
Code:
cap uat deploy
And then within the code we set a :branch symbol by asking for CLI input, like so:
Code:
set :branch, set(:branch) { Capistrano::CLI.ui.ask "Deploy branch => " }
Now, I want to be able to pass in the branch on the command line so I can script this. In Capistrano you just add the -S flag, so it's nice and simple
Code:
cap uat deploy -S branch=feature1
So now I have a local variable of branch inside my Capistrano script to use. This works:
Code:
inside the Capistrano recipe:
puts "the branch you passed in was: #{branch}"

output:
the branch you passed in was: feature1
All good.

But as soon as I try to assign it to a symbol, it treats the variable as a string, no matter what I do. I've tried every combination I can because 1) don't fully understand Ruby/Cap, and because 2) I can't find any information about this anywhere online. It might that I'm doing this wrong, but it feels like an obvious thing to want to do :confused:
Code:
set :branch, branch
set :branch, "#{branch}"
set(:branch), { #{fetch(branch)} }
set(:branch), { #fetch{:branch} }
Some of those cause an error, some of them set the branch to the string "branch".

Any clue? I'm completely stumped :(
 
Well, in the hope that you know, I'll give you my problem anyway :)

To deploy, we run
Code:
cap uat deploy
And then within the code we set a :branch symbol by asking for CLI input, like so:
Code:
set :branch, set(:branch) { Capistrano::CLI.ui.ask "Deploy branch => " }
Now, I want to be able to pass in the branch on the command line so I can script this. In Capistrano you just add the -S flag, so it's nice and simple
Code:
cap uat deploy -S branch=feature1
So now I have a local variable of branch inside my Capistrano script to use. This works:
Code:
inside the Capistrano recipe:
puts "the branch you passed in was: #{branch}"

output:
the branch you passed in was: feature1
All good.

But as soon as I try to assign it to a symbol, it treats the variable as a string, no matter what I do. I've tried every combination I can because 1) don't fully understand Ruby/Cap, and because 2) I can't find any information about this anywhere online. It might that I'm doing this wrong, but it feels like an obvious thing to want to do :confused:
Code:
set :branch, branch
set :branch, "#{branch}"
set(:branch), { #{fetch(branch)} }
set(:branch), { #fetch{:branch} }
Some of those cause an error, some of them set the branch to the string "branch".

Any clue? I'm completely stumped :(
Just so I've got this straight, you're not trying to assign a symbol, so much as set a Capistrano variable with the symbol to be the result of your string operation?

One possibly obvious clue - have you tried changing the variable name? "branch" seems to me scarily likely to be used for something else in this context.

If you're setting it with set, you do have to fetch it again, so your 2nd example wouldn't work anyway. But if you've successfully set a variable, the syntax in the last line looks as if it should work.
 
Holy shit, I've done. Only two days to figure out how to pass a variable to a script :facepalm:

Turns out I was doing it right, but my debug code was wrong :facepalm: :facepalm: :oops:
 
I love the free Lets Encrypt certificates that are available these days and the software tools to get them and renew then that have popped up for various platforms and scenarios. Saved my bacon several times in recent weeks and has given me the opportunity to explore a side of things I've avoided for many a year.
 
Today I have been mostly playing with React. I think I like it, but I'm only at the early stages of playing with it, and have had a few problems already (mostly with library shortcomings, rather than the framework itself, tbf).

Also, fun today at work: our customer's servers have been randomware'd so we can't post out any invoices etc. The ransom note says it's 2048 RSA with 128 AES, so it's practically unbreakable - our customers are currently searching online for tools to see if they can decrypt it :D :facepalm:
 
If its the one called Locky then I dont think they will find any tools, at least I didnt when a single machine at work got infected last week.
 
Fez909 are you using a tutorial for that? I was playing with the official fb one this morning and its awful! Really confusing, so recommendations welcome. I don't really do front end so this is all super new to me, and js is pretty horrible. :p
 
Back
Top Bottom