Friday, March 5, 2010

Macfusion error with sshfs in Snow Leopard

When mounting a drive with MacFusion, you’ll get the error that the remote host has disconnected. When you look at the log file, you notice that the error is actually in a shared lib: dyld: could not load inserted library: /Applications/Macfusion.app/Contents/PlugIns/ sshfs.mfplugin/Contents/Resources/sshnodelay.so.

To fix this, simply execute the following in your terminal:

mv /Applications/Macfusion.app/Contents/PlugIns/sshfs.mfplugin/Contents/Resources/sshnodelay.so /Applications/Macfusion.app/Contents/PlugIns/sshfs.mfplugin/Contents/Resources/sshnodelay.so.bak

This will prevent MacFusion from loading the offending shared lib. Everything works again :)

Tuesday, March 2, 2010

Force Safari to open all links in new tab

Firefox users have been able to open all links clicked within Firefox in a new tab for a while now, but what about us poor Safari users? Well, sure, you could always hold down command while clicking a link, but that's not fun, now is it? With this simple Terminal hack, you will be surfing like a pro!


Just open Terminal (/Applications/Utilities/) and type in the following command:

defaults write com.apple.Safari TargetedClicksCreateTabs -bool true

Once you restart Safari, all clicked links will open in a new tab. If you want to reverse the command for some reason, just replace "true" with "false."

Friday, February 19, 2010

Time Machine Preference Pane

http://timesoftware.free.fr/timemachineeditor/

Thursday, February 18, 2010

Changing hostname in macos

Stop DHCP screwing up your Mac OS X hostname

I'v got Snow Leopard, but DHCP is screwing my hostname all the time to something very random. Another thing that /etc/hostconfig goes away, while System Preferences in the Sharing tab does not sets hostname as hostname. Thus all older recipes are not really applicable anymore, once you're on Snow Leopard (I love changes). The cure is how to setup your hostname to, e.g. "Zeus" (that's mine one) like this (terminal and sudo privileges are required):

sudo scutil --set ComputerName zeussudo
scutil --set HostName zeussudo
scutil --set LocalHostName zeus

Monday, February 15, 2010

Setting up a SVN Server

Edit the file /etc/apache2/mods-available/dav_svn.conf and add the following lines at the end.


DAV svn
SVNParentPath /var/svn
SVNListParentPath on
AuthType Basic
AuthName "Foosball SVN Repo"
AuthUserFile /etc/subversion/passwd
Require valid-user


Restart Apache.

Missing JavaHL when using Subclipse on MacOS

The easiest thing to do is download and install the OSX package that is provided on openCollabNet. This installs Subversion, including the JavaHL library, into /opt/subversion. It then makes a symlink for the JavaHL library into /Library/Java/Extensions. This is a global location that the OSX JVM looks in when loading libraries via JNI. So basically, if you install this package, there is nothing else you need to do. It is OK to install this after you have installed Subclipse.

Tuesday, February 9, 2010

WLAN AutoConfig Service Failed To Start

Just a quick one today, I had a client come to me this morning with their Lenovo R61 notebook with Vista as the OS, complaining that they couldn’t get their wireless connection working. After a clean reboot the Error Dialog box that cam up said “Error Code: 1747 WLAN AutoConfig service failed to start”. So I tried to open up Event Viewer to have a look and that failed to load as well stating that the Windows Event Log Service failed to start.

So I opened up the Services MMC and tried to manually start the Windows Event Log Service and no luck, didn’t start. SO I did a bit of hunting and found that it could be related to a corrupt Windows Vista TCP/IP Winsock Catalog. So I ran the following command in the command prompt with admin privileges.

netsh winsock reset

What this does is reset the Winsock Catalog to a clean state or default configuration. After a reboot everything was fine.

Using CURL with cookies and authentication

The script is as follows.... Just replace URL, user and password with the appropriate strings.

#!/bin/bash
# Acquire RAT Page cookie
curl \
--trace-ascii curl1.log \
-c cookies.txt \
URL
#
# Sleep 2 seconds for operation to complete
sleep 2
#
# Acquire actual RAT Home Page using cookie
curl \
--trace-ascii curl2.log \
-b cookies.txt \
-u username:password \
URL
#
echo "Done"

Dynamips start and stop scripts

Start Script

echo "Creating Loopback Interface tap 10"
sudo modprobe tun
sudo tunctl -t tap10
sudo ifconfig tap10 169.254.10.1 netmask 255.255.255.0 up
echo "Created Loopback with IP Address 169.254.10.1"
echo "Starting Dynamips on Port 7300"
sudo nice -10 dynamips -H 7300 &
echo "Done"

Stop Script

echo "Shutting Down Loopback Interface tap 10"
sudo ifconfig tap10 down
echo "Killing Dynamips Processes"
sudo ps -ef | grep "dynamips -H 7300" | grep -v "grep" | awk '{print $2}' | xargs -l1 -i kill {}
echo "Done"

Tuesday, February 2, 2010

Using xargs to poll using SNMP

All SNMP OID's are present in snmp-packets file.

cat snmp-packets | grep -i "Object Name" | awk '{print $3}' | xargs -l1 -i snmpbulkget -Cn0 -Cr19 -c public -v 2c 172.16.153.140 {}

Friday, January 29, 2010

Clear Frequent Files from Start Menu - Windows Media Player

Windows 7 Start Menu is almost similar to Windows Vista however Windows 7 Taskbar aka superbar is way different from Vista & XP Taskbar. In Windows 7 Taskbar you have access to jump list and recently opened document list of Office word and for Windows Media Player you will get frequently played video list.

Same list of frequently played videos is also available in Windows 7 Start Menu if you have pinned Windows Media Player 12 (WMP 12) to start menu. Many users do not want others to see what videos they were playing. Here is guide on how to clear and stop displaying WMP 12 Recent/Frequent List for those who don’t know how to clear frequently player video list of Windows Media Player.

Follow below steps to clear and disable Windows Media Player Frequent/Recent list from Start Menu and Taskbar Jump list of Windows 7.

How to Clear & Stop Displaying Windows Media Player 12 Frequent List in Windows 7

1. Open Windows Media Player 12 (wmp 12) from start Menu

2. Now click on Organize and go to Options

3. Under Options, Select Privacy tab

4. Now under Privacy tab look at History Section

Click on “Clear History” to clear Frequent/Recent List of Windows Media Player 12

Uncheck Music, Pictures, Videos & Playlist to stop displaying Windows Media Player 12 Frequent/Recent List.

Monday, January 18, 2010

Firefox on Mac OS X tab problem

An unexpected behaviour of Firefox on OS X is that when tabbing through web pages, especially forms, certain elements are skipped. This is quite annoying when form filling since you cannot tab to the “submit” button (or use the “I’m Feeling Lucky” button on Google without resorting to the mouse).

Correcting this is in fact very simple!

Tabbing problems in Firefox in Mac OS X

The solution I found to the problem was somewhat unexpected. How to address this is that the end user have to turn on Full keyboard access > All controls in System Preferences for it to work as expected. Like this:

1. Open System Preferences

2. Go to Keyboard & Mouse

3. Select All controls for Full keyboard access

Alternatively you can add / change the accessibility.tabfocus Firefox option via about:config to one of the following:

3 to be able to tab to form controls or
7 to be able to tab to everything

Tuesday, December 8, 2009

Installing Windows 7 from a External Drive

Follow the Steps below to get it working.

1. Format the drive to make sure it has enough space to extract the Windows 7 ISO.
2. Extract the Windows 7 ISO on the external drive.
3. Make the partition active, so the drive can boot from it.
4. Make the drive bootable by using the commands below as the administrator
  1. Change directory to the DVD’s boot directory where bootsect lives:
    d:
    cd d:\boot
  2. Use bootsect to set the USB as a bootable NTFS drive prepared for a Vista/7 image. I’m assuming that your USB flash drive has been labeled disk G:\ by the computer:
    bootsect /nt60 g:
  3. You can now close the command prompt window, we’re done here.
5. Boot from the USB device.

Monday, November 30, 2009

Password reset for Mediawiki

The easiest way to avoid this problem is to set an e-mail address in your account, so you can use the “Mail me a new password” feature. However, if you find that you’ve forgotten the password to an account on your wiki, and you don’t have an e-mail address set for it, you can reset its password as follows:

  1. Log in to phpMyAdmin with your SQL password.
  2. From the menu on the left, select the database corresponding to your wiki, and select the “user” table within it.
  3. Click “Browse” at the top, and note down the user ID for the account whose password you want to reset. (This will be 1 for the first account.)
  4. Click “SQL” at the top, and run the following command, replacing “uid” with the user ID and “newpassword” with the new password for the account:
    • UPDATE user SET user_password = MD5(CONCAT(user_id, ‘-’, MD5(’newpassword‘))) WHERE user_id = uid

Mediawiki Upgrade

After a mediawiki upgrade, it is recommended to run the update script.

cd /var/lib/mediawiki/maintenance
php update.php

This will clean up the database.

More about Mediawiki Maintenance Scripts - http://www.mediawiki.org/wiki/Category:Maintenance_scripts

Monday, November 2, 2009

FTP Commands

In order to have the number of bytes transferred printed when using FTP, use the 'TICK' command

Tuesday, October 6, 2009

Make Safari open targeted links in new tabs instead of new windows

One of the things I find most annoying when browsing the web is when a link opens a new window. It completely disrupts my workflow when a new window pops up, especially when it does so without warning.

If you’re using Firefox this isn’t such a big problem anymore since it will open targeted links in a new tab instead, which is much more manageable and less intrusive.

For Safari, however, there is no such setting to be found when you look through its preferences window. But the setting does exist (at least in the Mac OS X version), though you have to use Terminal.app to enable it:

  1. Quit Safari
  2. Open Terminal.app
  3. Enter defaults write com.apple.Safari TargetedClicksCreateTabs -bool true and press enter
  4. Open Safari
  5. Notice that links that used to open in a new window will now open in a new tab

Much better.


Wednesday, August 26, 2009

Adding a persistent static route in Linux - RHEL

If you know there is always going to be a permanent route for a destination then a static route can be a viable option.To add a persistent static route in Redhat Enterprise Linux create a file called route-X in the /etc/sysconfig/network-scripts/ directory

where is the interface number and X is the interface number. As you would expect, these are specified in seperate file for each of the available interface.

Example:

/etc/sysconfig/network-scripts/route-eth0
/etc/sysconfig/network-scripts/route-eth1

Every entry or a route has three entities as follows:

GATEWAY=xxx.xxx.xxx.xxx
NETMASK=yyy.yyy.yyy.yyy
ADDRESS=zzz.zzz.zzz.zzz

As the names implies, they are the gateway IP, Netmask and the IP/Network Address

Note the next to each of the three entities. This number defines the route entry number and should be the same on all the entities.

Example:

GATEWAY0=192.168.1.1
NETMASK0=255.255.255.0
ADDRESS0=10.10.10.0

GATEWAY1=192.168.1.1
NETMASK1=255.255.255.0
ADDRESS1=20.20.20.2

A sample file /etc/sysconfig/static-routes is available for your reference.

Once the file is created, restart the network service as follows:

# service network restart

To view the routes type

# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
192.168.2.0 * 255.255.255.0 U 0 0 0 eth1
10.10.10.0 * 255.255.255.0 U 0 0 0 eth0
20.20.20.2 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

or

# ip route show
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.1
192.168.2.0/24 dev eth1 proto kernel scope link src 192.168.2.1
10.10.10.0/24 via 192.168.1.1 dev eth0
20.20.20.2/24 via 192.168.1.1 dev eth0
default via 192.168.1.1 dev eth0

To dynamically add a route, try the folowing:

Syntax:
# ip route add / via dev X

Example:

# ip route add 10.10.10.0/24 via 192.168.1.1 dev eth0

or

Syntax:

# route add [-net|-host] netmask gw dev X

Example:

# route add -net 10.10.10.0 netmask 255.255.255.0 gw 192.168.1.1 dev eth0

This should help.

Tuesday, August 18, 2009

Turn off System Beep in Windows XP

When you spend a lot of time in front of your computer, the annoying beeps start to drive you mad after a while. I really don’t need to be told that I hit the wrong key anymore, so I’ve compiled a list of how to turn off all the system beeps in Windows XP.

One of the most irritating beeps happens when you use the Volume control… but there are other beeps, such as on error dialogs or when you hit the wrong key.

image

Disable Beep in Device Manager

Open up Device Manager by right-clicking on Computer and choosing Properties, then on the Hardware tab you’ll find the button for Device Manager.

image

Select View \ Show hidden devices from the menu.

image

Find Non-Plug and Play Drivers in the list, and then right-click on “Beep” and disable it:

image

When it prompts you to reboot, select no, and then right-click again and choose Properties this time. On the Driver tab, change the Startup type to “Disabled” and then click the “Stop” button if you are able to.

image

This should disable the system beep speaker, but it probably won’t change the volume control beep, so continue on.

Disabling Beep in Registry

Open up regedit.exe through the run box, and then navigate down to the following key:

HKEY_CURRENT_USER\Control Panel\Sound

image

Find the “Beep” key on the right-hand side and change the value to “no”.

Disable Beep in Sounds Panel

Open up Control Panel and find the Sounds and Audio Devices panel, choose the Sounds tab and then find “Default Beep” in the list.

image

Change the sound drop-down on the bottom to “None” and then click Apply. This should disable the volume control beep.

You’ll want to also change Critical Stop to “None” as well, and should probably also turn off some of the other items.

You can also use TweakUI to get rid of some of the beeps, but if you follow the items on this page you shouldn’t need that.

Original Source: http://www.howtogeek.com/howto/windows/turn-off-the-annoying-windows-xp-system-beeps/

Monday, August 17, 2009

Gtalk Scroll Bar

To see all your friends instead of just the one page default, Login to gtalk, at the bottom of the gtalk window you will see a button "View". Click on this button and unclick 'show in one page' (you will need to click that option), that’s it you will see a scrollbar.