Here’s a really quick tip. If you’re running Windows and are using PuTTY to manage your unix servers, chances are you have a lot of saved sessions i.e. information on how to connect to your server, what font type and size to use, etc. And if you ever tried copying them to another machine you noticed that PuTTY doesn’t have a user-friendly export/import sessions button. But there’s a way to perform a saved sessions export manually. PuTTY keeps all session related information in system registry, so what you can do is export that part of the registry tree to a file with the following command:
In this tip I want to share with you a quick and easy way of creating your own time lapse videos using your webcam and a tool called FFmpeg. I just recently discovered this command line tool myself and can think of various cool uses for it e.g. connecting a webcam to a Raspberry Pi and leaving it somewhere to take snapshots on certain events, or stream video of some place you want to monitor.
In this post I’ll try to share my recent experience with Velocity template debugging. There are a few ways to debug the templates depending on where you think the problem lies. But at times you have modify templates written by others and that’s when you need to do some exploring like finding out what variables are actually passed to the template. This is not always easily found in code, sometimes it’s simpler to print this stuff out when you’re already in the template. Below is a macro that I used to print out request and session attributes and parameters.
I was experimenting with WebGL the other day and it’s pretty damn cool. Here’s a spinning 3d logo of the company I currently work for as an attempt at animating something in 3D. If you’re not in the loop, WebGL is a JavasSript API supported by modern browsers that allows interactive 3D graphics rendering in a browser’s window, specifically the canvas tag. The graphics rendering is GPU accelerated which means excellent performance (as long as you’re using it wisely). The API is designed by the Khronos Group and is based on OpenGL ES 2.0. If you ever used OpenGL then it will be easier for you to start, but similar to OpenGL ES the WebGL API doesn’t have the immediate mode which is widely used in OpenGL tutorials. If you want learn WebGL you’ll need to get better acquainted with the concept of shaders which are lower level programs executed on the GPU. Depending on the type of shader, they’re executed for each vertex of the object or each pixel to be drawn. Those things are fast as hell. If you want a good place to start learning this stuff see Learning WebGL blog. But note that they may not explain all the nitty-gritty details, so you’ll probably end up searching for more information elsewhere. Another good resource is the official WebGL cheat sheet or reference card, whatever you wanna call it. But before you go and start programming something for your page, note that WebGL is not supported by all the current browsers and some visitors might not see the graphics at all. If you can’t see the spinning logo demo yourself then you could try switching browsers. Like using the latest version of Chrome or Firefox (these work for me). But chances are that your particular hardware might not be supported even by those browsers. I’ll finish up by leaving you with a link to some really cool looking WebGL demos. Enjoy!
It’s been quite a while since my last post so I’ll try to ease back into blogging. For now I’ll just share a little something I created for myself to help with the SSH tunnels that I need to create on a seemingly regular basis. Sometimes I forget or mix up the parameters that need to be passed to SSH client, especially when interconnecting these tunnels. In this simple tool you can enter the missing info to form a logical sentence in English language and when you click the generate button you get a command line for the SSH client. Pretty user friendly ;) And if you’re not sure what SSH tunnels are and why you need them, take a look at this post on SSH hacks.
A couple of months ago I’ve switched from Java development to developing for Mac OS X. Let me tell you, it’s a completely different world, but that was to be expected. The first thing is to get acquainted with the OS and it’s features. That actually didn’t take too long. I’m really pleased with the availability of a full-fledged UNIX console in the OS, so I’m able to leverage all of my linux knowledge. The eye candy and the elegant design of most of the applications really give you quite a difference experience of using the computer than it would be on another OS. And at the end of the day, I guess, that is the most important factor for most users. Feature-wise Mac OS X has all the benefits of *BSD systems, being a derivative of FreeBSD and all. Over the years I’ve been using different OSes and for a long time now, I’ve not seen many major issues in any of them. I would suggest that such things like stability are not really a factor for choosing an OS nowadays. All of the OSes struggle to be as stable as they can be and the result is reasonable. I’d say that neither Mac OS X nor linux nor any other OS is the silver bullet, but some are better than others. I had experienced a application crashes in every OS I worked with. No matter how good the OS is you still need your day-to-day software to be well written and stable. Sometimes it’s a matter of configuration and sometimes you’re just at the mercy of the application you’re using. When switching to a Mac you cannot overlook the sleek design of Mac OS X which I believe does lure a lot of users. I guess, I would agree, that this sort of design looks more profesional and makes a different impression on someone if say, you would be presenting something to your client vs. showing them something on Windows Vista.
I haven’t posted in quite a while. Been busy with all the job switching, getting used to Mac things and such. On another topic while cleaning up my hard drive I’m finding various neat stuff, that I forgot about. Will try and share some of it with the rest of you. These are mostly things that you either need or don’t care about at all. One of those things is a screencast that I’ve forgotten I made. It was created for a competition hosted by NetTuts+ and touches on some of the basics of PhoneGap platform. I didn’t actually win and now it’s a shame I remembered it only a few months later, but perhaps it could still be useful to someone.
Hi there! Here’s another quick suggestion for all of you out there who have to deal with a lot of web server environments and need to make sure that they’re all alive and responsive. Sure there are all sorts of tools for server monitoring and performance tracking, but I found that most of the time you just need to know if the server is up & running. And of course you should be notified if it’s not. Here’s my short Python script that does just that. You will need to tweak it a little to use in your environment. First of all I’ve set the content threshold to 2000 Bytes which means that the expected length of the page content returned is no less than 2000 Bytes. If it’s below this value, one could assume that something’s fishy going on. You might want to change this value to something else depending on what your web server returns. Another thing that you’ll want to change is the servers dictionary in the main() method. The logic behind this is that each of the web servers is assigned a responsible person that you would need to inform if something is wrong with the server. You should list all your servers that need to be monitored and the responsible person’s e-mails. The final change is on the line where you instantiate the HeartbeatMonitor class. The first parameter admins is a list of e-mails of the people who will receive the notification if any of the servers are down. You can leave this list empty if you want, but I usually put my e-mail in there since I like to be in the loop. The second parameter mailServer is the SMTP server which will be used to send notifications so make sure this one is set correctly. This parameter is actually optional and localhost will be used as the default mail server if you decide to skip it.
I’ll keep this one short. Don’t know about you, but I’ve always been frustrated about how most FTP clients won’t let you search for files on a remote FTP server. I remember I used some client that had this functionality, but this was quite a while ago so I can’t even remember the name of it. If someone else knows any lightweight tools that let you do that, please leave a comment. Recently I needed to do some quick searches on the servers that I have only FTP access to. And you know what they say… “when you can’t find the right tool for the job – write it yourself” Actually I don’t know if anyone says that :) but I decided to do it and put together a Python script just for this task. I’m not sure if many others have run into a similar problem, but I put it on GitHub anyway. I called it FTP search for obvious reasons. You can find the script and a short documentation there. The only prerequisite is that you have Python 2.7.x installed. I can’t promise you that it will work with Python 3.x but you’re welcome to try. If you have any ideas on how to improve this little tool and wish to contribute then leave a comment bellow or contact me via e-mail that’s specified on GitHub’s project page.