Archive for ‘Tutorial’ Category
Posted on 12:55, September 25th, 2008 by Many Ayromlou
I’ve had this question a couple of times in the past few months (since I posted the command line version of this method here ). To make it short and sweet, yes you can use Putty in a windows environment to setup ssh tunnels. Here is the specific scenario with pics for setting up a tunnel to your mysql server (assuming mysql server is running on a machine that you have ssh access to) using putty. This allows you to run mysql-gui-tools under windows and connect thru ssh to your server, without having to open the server to accept connections from the network.
So now you’re done. If you need to access your mysql server, first run putty, load the session we just saved, connect and you’re good to go. You can use any network based mysql frontend and even the ODBC connector under windows and point them at host: 127.0.0.1 and port: 3306, the SSH tunnel will then take the traffic and safely transfer it to your mysql server box. This way you can run your mysql server in local mode — where it will not accept connections from outside network — for safety reasons and have network access to it when you need.
Posted on 16:15, May 7th, 2008 by Many Ayromlou
A lot of people seem to be running into weird network problems with Vista (MS’s latest abortion). The symptoms might include:
– Windows messenger issues (disconnects, slowness)
A possible solution is turning off auto-tuning. You see Vista being Vista, wants to always be in control, even when it gets on the network with others. MS has built a new feature into it’s network stack that allows Vista to auto-tune the size of the send/receive windows…..why would you want to do this by default when half the worlds firewalls discard non-standard packet sizes is a mystery (apparently only known to MS ppl). So guess what happens when the firewall downstream of you decides that your packets are “non-standard”……it drops them, along with your connection. So how do you fix this, simple, you do what MS should have done before they shipped you the abortion called Vista, you disable it. Here is how:
1) Get a command prompt in administrator mode. To do this go to Start/All Programs/Accessories and RIGHT CLICK on command prompt’s icon and choose “Run as Administrator”. On the next prompt press “Continue”.
If you like to get rid of the stripes in the list view of the new Leopard Finder, open a Terminal Window and type in the following two commands:
Just noticed that if you place your dock on either side of the screen you get a flat dock, instead of that floating 3d look. As much as I like the 3D look, I liked the flat look even more, so after poking around I found out how to disable the 3D look. Open a Terminal window and type in the following two commands:
OSX Webmaster special: Shared webserver, bad umask settings, group permissions and filenames with spaces…
Posted on 12:20, October 24th, 2007 by Many Ayromlou
Okay so this all started with our users not being able to share files on our webserver. We use SSH only for upload/download and interactive access (ie: no ftp). Through trial and error we found out that the default umask (under OSX Server) for sftp uploaded files are 0033 (ie: rwxr–r–) and directories are 0022 (ie: rwxr-xr-x). This creates a problem when one user uploads a file and another user downloads/modifies and tries to re-upload it — they simply can’t because the group permissions are wrong.
If we were using ftp (which we are not) there are some solutions on the net that allow you to modify the startup parameters for the ftp server so that the default umask for all files is 0013 — which would allow a group of people to share/overwrite each others files — but we are using ssh only.
So we came up with two other solutions — a shared upload account and/or a cron job that would modify the group permissions on the website directory to allow group sharing. We went with the second solution and that’s where I ran into so many problems that I decided to create this post. You see normally Unix users know that spaces (and strange characters) in filenames are a no-no. Well that’s not true for Windows and Mac users, they use spaces and other odd characters in their filenames/folders all the time.
I started writing — what I thought was — a simple “for loop” script to go through the website folder and change the group permissions. Of course on the first try things didn’t work nicely because of spaces, so I started compensating for that and came up with:
Finally after a latenight RTFM session (and lots of cursing), I think I’ve found the ultimate file handling loop statement:
After trimming and optimizing the script a bit, here is the final product:
Posted on 20:26, October 7th, 2007 by Many Ayromlou
So after hearing from people at work how great the “screen” command was (yeah welcome to gnuland boys and girls), I decided to do a short tutorial on screen. This way I can stop telling them to RTFM and instead tell them to RTFB (Blog). Anyways, What is “screen” first of all….From the pages of wikipedia:
Think of screen as a Virtual Machine (I know it’s not but bear with me). Once you run the command, the ‘virtual machine’ takes over and allows you to create multiple interactive command line sessions. In each of those sessions you can run commands that are either interactive (menu based) or serialized. Once you’re done you can disconnect the session — keeping in mind that the session is actually alive and running, including all the programs that were spawned inside that session — go to another computer and ‘restore’ the session with all the programs still running. By far one of the coolest things about screen is that it automatically allows you to nohup your commands, by just disconnecting the session and reconnecting to it later. So without any further due here is screen:
Obviously you need to run it, so first step is to type screen at the command line. When you do that you get a new shell window and the adventure starts. Remember that pretty much all screen commands start with Ctrl-a followed usually by a character (ie: you press Ctrl button and c together, let go, and follow it with the character).
So now you have a new shell, run a command (ie: pine, vi or something). Okay so now we can simulate you leaving your machine and detaching your session.
– To Detach : Ctrl-a d (this will detach the session but your command is still running inside that screens shell….you’ll see)
So now you’ve got the very basics of screen. Detaching allows you to run commands, leave them halfway, detach and go somewhere else and use Re-attach to restore the session.
Now, how about multiple sessions. Yeah you can do that too, one screen process with multiple sessions inside it.
– Use screen -r to reattach to your process (If you haven’t done so already). Note that your program is still running (say vi). If you now want to run lynx for example you can use the Ctrl-a c command to create another session (c for create). So now you have two sessions inside your “screen virtual machine”.
One last thing before I take away the training wheels, to kill your screen process (and all sessions running inside it) use Ctrl-a Ctrl-\.
Okay, so here is a small list of the many screen options and commands:
– Ctrl-a “ : gives you a full screen list of all your sessions and you can scroll down to the one you want to switch to and press Enter (remember to get “ you have to use Shift-‘ and ESC gets you out of the list).
Here are a couple of more useful startup screen commands:
– screen -ls : will list all the screen processes running under your userid (yes you can run multiple screen processes with multiple sessions inside each).
As usual screen is controlled via .screenrc file for configuration parameters (there is a system wide file in /etc/screenrc and the personal one in your home directory, under ~/.screenrc). You can add the following commands in your personal .screenrc to make life a bit simpler:
As usual there is a lot more to screen, so once you’ve got the basics nailed, take a peek at the man pages for more goodies and don’t forget…..Command line is your friend :-).
From the pages of really useful, well designed websites comes Mango. The webapp (flash 9.0) is simple to use, well layed out and generally works well. It offers 11 Free language courses (Brazilian Portuguese, Polish, Spanish, French, German, Greek, Italian, Japanese, Mandarin Chinese, Pig Latin and Russian). So head over, sign up and learn something new. It’s FREE!!!
Posted on 05:25, August 23rd, 2007 by Many Ayromlou
Yeah, you heard right, I’m gonna show you how the mouse pointer on your computer really works. To do this we have to zoom in a portion of the screen. When you move to the next page, move the mouse to the centre of your screen and have a look. Also try clicking your mouse button. Now you know the secret…You are a true NERD :-)