OS X Kill Finder or Dock

When you are getting the spinning beachball on Mac OS X System Applications/Tools, like the Finder when trying to connector to a failed network share. Your solution is the always winning Terminal. Start Terminal through menu or spotlight, and try the following commands.

The Finder crashed:

killall -KILL Finder

The Dock crashed:

killall -KILL Dock

Spaces crashed:
killall -KILL Dock

The Menubar crashed/refuses to be clickable:
killall -KILL SystemUIServer

The services should automatically restart after they have been killed. If they dont, you might have to reboot your computer. If this option is not available through menus, get back to Terminal and give the following command:
sudo shutdown -r now – provide your Admin password and your machine should be restarting).

Fix Cisco IPSec VPN timeout on OSX

There is some kind of bug in the built in Cisco IPSec implementation on OSX since Mountain Lion.

A lot of users experience that the connection drops after everything from 45 to 75 minutes. There is a solution but it demands a bit of “hacking” on your part.

Here are the steps to follow :

1. Connect your Cisco IPSec connection
This will create a file in /var/run/racoon called x.x.x.x.conf, where the x´s represent the IP address you are connecting to.
2. Copy this file to /etc/racoon with :

3. Go to /etc/racoon and open the file for editing
4. The following values need to be edited :
Dead peer detection needs to be set to zero (0)

‘Proposal check’ needs to be changed from ‘obey’ into ‘claim’:

The lifetime value needs to be raised from 3600 seconds to a new value. In my case i set this to 168 hours. (any value you choose will do, but I found this is workable in most cases)You will have to change this in ALL Proposal sections.

5. Save the file
6. Now you need to open racoon.conf for editing
7. Right at the end of the file, change the following value :
Comment out ‘#’ at the very beginning of the last line that starts with ‘include’;
Then type the following line directly under that:

Make sure to use the name of the file you have created

Disconnect from your VPN service and reconnect.
Your connection will now stop dropping out.

Host discovery with curl

Yesterday i discovered a cool webpage called ifconfig.me
It displays information about your external IP and other HOST information.

The cool thing is that it is designed for use with curl from the command line.

Your external IP
curl ifconfig.me

Your hostname
curl ifconfig.me/host

Your user agent
curl ifconfig.me/ua

External connection port
curl ifconfig.me/port

Display all your information
curl ifconfig.me/all

Extremely useful for command line geeks like myself :)

4Chan Imagedownloader

Earlier this year i wrote a small python script for downloading images from 4chan threads.

It is available now from this page

Credits need to be given to David Tucker for helping out :)

Version 1.1
After a comment i added some changes.
See the usage description for information about v1.1

Simple filesharing in Linux – Python HTTPServer

So, want to show something on your machine to another user? Or want to share a file ?
If you have Python installed (default for most *nix systems) the following trick is awesome.

Create the following alias in your .bashrc

alias webshare=’python -c SimpleHTTPServer’

Now just type the command “webshare” in your terminal, and all files in current folder and beneath will be available at

http://localhost:8000

If you dont want to create an alias, just type the following command in your terminal

python -c “import SimpleHTTPServer;SimpleHTTPServer.test()”

Remember, if you start the webserver in your /home/username; folder, you share everything in the folder !

NetHogs – See what process uses your bandwidth

Ever wanted to see what is taking up your bandwidth. There are lots of tools out there for this, but lately I have been taking a closer look at NetHogs.
It is really worth checking out..

NetHogs is a small ‘net top’ tool. Instead of breaking the traffic down per protocol or per subnet, like most tools do, it groups bandwidth by process. NetHogs does not rely on a special kernel module to be loaded. If there’s suddenly a lot of network traffic, you can fire up NetHogs and immediately see which PID is causing this. This makes it easy to indentify programs that have gone wild and are suddenly taking up your bandwidth.

Download Nethogs here

Apache2 + userdir + php – Not working

I just configured a new webserver and wanted to use the UserDir option.
Enabling UserDir gives you the option of placing webfiles in a public_html folder in your home folder. You can access the webfiles through http://yourserver.com/~UserName/.

The problem i encountered was that .php files wouldnt show, they where just downloaded.

Solving the problem was easy, just open php5.conf in /etc/apache2/mods-enabled.

Edit it to replicate the listings below (uncomment the same lines in your config).

Now restart Apache2 with : sudo /etc/init.d/./apache2 restart , and you are good to go.

Command Line encrypt & decrypt of files – OpenSSL

Ever had the need to quickly encrypt a file?
We have previously shown you a tool called Cryptor for simple Encryption/Decryption on OSX.

In this post we will show you how to use OpenSSL.

OpenSSL - Command Line usage

With OpenSSL you can perform quick and easy encrypt/decrypt of files from the Command Line.
As long as OpenSSL is installed on your system, you can use the same examples as below on any OS (Windows,Linux,OSX).

Continue reading

Gnome – Loosing Maximize Minimize buttons in titlebar

On my Linux Mint installation i have recently experienced that the titlebar is gone. Loosing the minimize,maximize and close buttons.

I have been doing some extensive googling on the problem and found two solutions, whereas only one worked for me.

Open terminal and type :

metacity –replace

This solution worked on my Linux Mint 11 installation

The solution below did not work for me, but others have stated that it worked on other Gnome based distros.

Open terminal and give the command:

xfwm4 &

Backspace error in SSH sessions – acts as Delete key

In OSX 10.6.xx (Snow Leopard) users who use the Terminal application to SSH into remote servers might experience that the backspace key works as the delete key in some applications (VI, Nano, Pico etc) I have not heard of this happening in any other OS or application, so an easy way to fix this in Terminal configuration on your Mac.

Go to Terminal preferences, select the Advanced tab, and check “Delete sends Ctrl-H”. That’s all it takes to get the “delete” key to work correctly in all applications used in your SSH sessions.

 

 

Install Dropbox on Linux Server

Dropbox is probably the best way of sharing files quickly and secure today. The possibility of instant syncing between computers makes it a must have for every geek with several computers active.

But installing it on a X free Linux server, has so far been a bit tricky.

Not anymore – some guys have made an excellent script for installing Dropbox and linking to your account.

Check it out here

Tweaking Ubuntu – Hidden settings

Ubuntu Tweak is a tool that lets you change hidden Ubuntu settings, for example: hide or change the splash screen, show or hide the Computer, Home, Trash, and Network icons, change Metacity, Nautilus, power management, and security settings, etc. Currently Ubuntu Tweak is available only for the Ubuntu GNOME desktop, i.e., it will not work on Kubuntu or Xubuntu.

Continue reading