RSS
 

Archive for the ‘Tips and Tricks’ Category

Setting up SSH keys

25 Jul

Sometimes you work with your remote host so much, that having to enter a password every time becomes a real pain. If that is the case, you should follow with this instructions to set up automatic handshake with your remote host.

First off, you have to have OpenSSH on both the host and your local machine. SSH into your remote host to create the “.ssh” directory in your home folder.

Now we are going to use the SSH Key Generator to create the authorized key.

ssh-keygen -t dsa

You will be prompted to enter a passphrase for this identity key. Choose something hard to break.

Now all you have to do is copy the identity key to the remote host.

scp ~/.ssh/id_dsa.pub myuser@remote.host.com:.ssh/authorized_keys2

Of course, you will replace “myuser@remove.host.com” with your actual remote host’s access information. Now, you will run a simple script that will tell the remote host which identity it should use, and also starts a new shell that will enable you to SSH to the remote host without entering any passwords.

ssh-agent sh -c 'ssh-add < /dev/null && bash'

Now try typing “ssh myuser@remote.host.com” and you will see that you are all set.

 

THE Blog Client for Mac?

21 Sep

The past few days have been a very critical time for my blogging experience. I have been trying different blog clients for Mac, and I was slowly, albeit surely, coming to the conclusion that there is no good blogging client for Mac. On my Windows 7 PC, I used to blog with Microsoft Windows Live Writer. It actually downloaded my WordPress blog theme and let me type as if I was writing on the blog itself. It could add annotations, had plugins to provide Wikipedia quick-links, and in short, anything I would have wanted from a blog client. So, when I started my search, the standard was set pretty high.

Here is a list of all the different applications I’ve tried on my Mac:

  • Ecto: didn’t even come close to satisfying me. The WYSIWYG editor was buggy and annoying. And I really didn’t like the UI.
  • Qumana: Didn’t support online drafting, had no way of inserting multi-media content, and didn’t provide a friendly user-interface.
  • MacJournal: didn’t do me much good, as a blogging client. As a replacement for my note collector software (OneNote on Windows) it did great. But it’s lack of support for correct media uploading left me disappointed. Sure, I could configure FTP access for my website, but that would have required tweaking the user permission settings from the server side and I wasn’t going for that.
  • Blogo: it was great. Except it didn’t allow me see or edit WordPress pages. Also I had some problems uploading. The UI was awesome. I particularly loved the Fullscreen view which allowed me to write without being distracted by everything else.
  • MarsEdit: MarsEdit wasn’t that much better than Blogo; but it currently is my editor of choice. It allows me to do most of the things I used to do with Windows Live Writer and the UI isn’t bad. There are currently no uploading problems and the spellcheck works just fine. It also has a Preview option, much like Windows Live Writer.

MarsEdit Main Window

Well, that’s it for now. I hope by reading this you can save some wear and tear – and some bucks of course :-) .

 

A Cleaner Firefox

08 Aug

If you are as obsessive as me about having a clear desktop, a clean browser is an essential for you, too. Today, I finally got what I desired out of Firefox. As a bonus, I also got around integrating Firefox with Windows Seven as much as possible without installing any external applications, like Winfox.

Tidying it up

The very first step in tidying Firefox up, is to install Omnibar. Omni bar is an add-on that will integrate “location bar and search bar into one”, and also “shows search and url suggestions”.

Omnibar gives you one, clear address+search bar

After installing Omnibar, I was struck by the picture: the bookmarks toolbar I once loved so much looked so ugly, now. So, I just hid it.

After I had done all that, I installed Compact Menu 2, a very cool add-on that let’s you hide the menu bar inside one, tiny button. So, that’s just what I did.

By doing just these three simple steps, my Firefox now gives me about 70 pixels more reading space, and 70 pixels less crowded, clickable widgets.

Windows Seven Taskbar Integration

After that, I was tempted, and persuaded, to try out "NEW Glasser by SzymekPL”, which gave me a very nice, sleek glass effect on the whole Firefox frame.

Firefox with Glasser

This was too cool to leave it alone, so I just Googled for Taskbar integration, and found out that in Firefox 3.6, taskbar integration is a built-in feature, and is simply disabled by default. So, I got on with it, and enabled it by first typing “about:config” in my location bar, and then toggling “browser.taskbar.previews.enable” to true. Now, I have individual tabs preview in my Windows Seven taskbar for Firefox.

Taskbar thumbnail previews for Firefox 3.6

If you want to take it even further, and use jumplists and another Windows Seven goodies in Firefox, you can install Winfox, but I, personally, don’t fancy the idea of installing another application just to smooth my original application up a little.

 

Using Linux Shell to Add a User

12 Jan

Hiya all. As I continued to work with my remote server’s shell, a new issue arose. I needed to add a new user to my system.

So, suppose that you want to add Mr. Friend to your system via bash:

useradd mrfriend

Okay, now you need to set a password for our friend:

passwd mrfriend

You will be prompted to enter the password and confirm it.

However, to do all this you need to be root. To do so, before entering any of these, type:

su -

Don’t forget the “-“, because otherwise you will get a “command not found” when you issue “useradd”.

Note: On some systems the command is “adduser” instead of “useradd”.

 

Kill users in Linux shell

08 Jan

Okay, first off, this is not a tutorial to show you how to kill your nemesis. For that, you need to take shooting lessons (or maybe, learn how to mix poisons).

Killing here means logging out a user. This can be particularly useful if somebody has logged into your PC whom you don’t want to have access. Or whom you simply don’t like.

For instance, if you are managing a server, and a particular user is eating up all the bandwidth and also won’t listen to reason, you can just log him out. Simple as that.

There’s a good set of utilities called “procps” which might come handy. It contains a tool called “skill” which helps you send signals and such to users and other active (or inactive) processes.

Okay, enough talk. Let’s send some cool signals.

The syntax of the skill command looks like this:

skill -SIGNAL -u USERNAME

There are a possible number of signals you can send. And obviously, you will be sending those signals to the user with username “USERNAME”.

Signals to send to users

You can send these different signals to users:

  • stop; which means you want that user’s activities to be halted. It’s like pushing the “Pause” button on a video set.
  • cont; is the resume button, whereas “stop” was the pause. You can use “cont” to allow the user to continue with his/her activities.
  • kill; now, this sounds like something the Dark Lord would have loved. You send the “kill” signal, the user’s session ends.

Example: Logging out “mr-enemy”

Okay, suppose your enemy – with the convenient user name “mr-enemy” – has logged into your system, and you want to log him out, just to spite him.

Here’s what you do:

skill -kill -u mr-enemy


Easy, no? You can also halt his session to irk him some more:

skill -stop -u mr-enemy

More Information

One thing to note, is that to stop a user you have to be “root”. More information on the skill command can be found by typing into your shell:

man skill

There, you will (probably) see that it is a deprecated command. However, I myself couldn’t find a replacement.

Other useful commands from the procps package include: top, kill, w, free, and vmstat.

Tired of your life?

No problem, you can even commit suicide with Linux shell:

skill –kill –u [yourusername]

where [yourusername] is replaced with your user name (surprise!).

Note: NEVER kill the “root” if you don’t want to cold reboot your system!