How to mount a windows share (samba) from the linux command line

As you know Linux does not use drive letters like Windows does. All files are organized under a big tree hierarchy. We use the mount command to mount partitions and this is the same command used to mount remote windows partition or windows shares.

Please note that you’ll need to know the following:

  • Windows username and password (the ones needed to access the share)
  • The machine and share name. Something like //xpdesktop/pictures
  • Have root access on the linux machine

Login on your linux machine as root. Type the following command to mount your remote windows share:
[ccNe_bash]
mkdir /mnt/share_name
mount -t cifs //xpdesktop/pictures -o username=john, password=johnspass /mnt/share_name
[/ccNe_bash]
Where:

  • xpdesktop is the network name of the Windows machine
  • john is the username on  the windows machine
  • johnspass is the password used to access the windows share
  • /mnt/share_name is the target folder where the partition will be mounted (the folder you just created above)

You can now cd and ls the remote windows share as any other folder on the linux machine:
[ccNe_bash]
cd /mnt/share_name
ls  -l
[/ccNe_bash]
I’ll show you in a following article how you can automatically mount a remote Windows share at boot time.

Old Soundblaster Live 5.1 on windows 7

I tried running Windows 7 on a machine that had a Creative Sound Blaster Live 5.1 card inside. Since the 5.1 is a decent card I see no reason to replace it just because windows 7 came along. Please note that these unofficial updated drivers also bring along Windows 64 bit support. A quick google search revealed this:

http://forums.creative.com/t5/Sound-Blaster/SB-Live-series-Support-Pack-1-5-08-09-2009/td-p/533861

Please note that this is an unofficial patch and that it has problems if your Windows 7 machine has more than 2 Gb of RAM.

Read all the details and download the package over to the above address. Let me know if it goes offline, I can upload them too somewhere.

Checking directory sizes from the BASH prompt

The command ls can be made to show directories and permission but it will not display directory sizes. Then it’s time for other commands. For example on my hosting account there is no file manager installed and evidently x and kde is missing too so, to find out directory sizes I can use the du command. It will show something like this:
[ccNe_bash]
du -h –max-depth=1
3.2M    ./wp-admin
24M     ./wp-content
5.9M    ./wp-includes
4.0K    ./cgi-bin
44M     .
[/ccNe_bash]
BTW the command above shows a typical WordPress installation. What I used was the switch -h which provides human readable sizes for folders (like Kilo, Giga, Tera, etc.) and I also used the swithc –max-depth to tell du only to go one folder deep otherwise it will also show the sizes of every subfolder from the current one down.

Should you like to have those results sorted it’s only a matter of piping the results of du into sort, like this:
[ccNe_bash]
du -h –max-depth=1 | sort -nr
44M     .
24M     ./wp-content
5.9M    ./wp-includes
4.0K    ./cgi-bin
3.2M    ./wp-admin
[/ccNe_bash]
What sort does is – surprise, sort it’s input. The switches used are -n to tell sort to sort by numerical values and -r to reverse the results (from big to small). Of course from here on you can pipe to text files, use even more complicated constructs but this should take care of the base.

If you managed to sort your folders how about sorting my wish list 🙂 don’t forget to click a sponsor.

Wake on LAN a machine using Python – WOL

This is something useful: code to wake up a machine on lan using python. Since python is available on most devices now (symbian, maeom, windows, linux and so on) it’s pretty usefull. So, if you have machines that you want to be able to start this is the code to do it. I found it floating on the internet but since it’s GPL I see no problem in posting it. Full credit and thanks for the useful code go to the author. BTW I use this on my n800 tablet to wake up my backup server and my media center pc – what will you use it for?
[ccNe_python]
Wake-On-LAN
#
# Copyright (C) 2002 by Micro Systems Marc Balmer
# Written by Marc Balmer, marc@msys.ch, http://www.msys.ch/
# This code is free software under the GPL

import struct, socket

def WakeOnLan(ethernet_address):

# Construct a six-byte hardware address

addr_byte = ethernet_address.split(‘:’)
hw_addr = struct.pack(‘BBBBBB’, int(addr_byte[0], 16),
int(addr_byte[1], 16),
int(addr_byte[2], 16),
int(addr_byte[3], 16),
int(addr_byte[4], 16),
int(addr_byte[5], 16))

# Build the Wake-On-LAN “Magic Packet”…

msg = ‘xff’ * 6 + hw_addr * 16

# …and send it to the broadcast address using UDP

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.sendto(msg, (”, 9))
s.close()

# Example use
WakeOnLan(‘0:3:93:81:68:b2’)
[/ccNe_python]

Memory limits of various Windows versions

Thinking of a memory upgrade? An operating system upgrade? Here’s a table from msdn stating the limits imposed by 32 and 64 bit editions of various Windows versions.

Physical Memory Limits: Windows 7

The following table specifies the limits on physical memory for Windows 7.

Version Limit in 32-bit Windows Limit in 64-bit Windows
Windows 7 Ultimate 4 GB 192 GB
Windows 7 Enterprise 4 GB 192 GB
Windows 7 Professional 4 GB 192 GB
Windows 7 Home Premium 4 GB 16 GB
Windows 7 Home Basic 4 GB 8 GB
Windows 7 Starter 2 GB 2 GB

Physical Memory Limits: Windows Server 2008 R2

The following table specifies the limits on physical memory for Windows Server 2008 R2. Windows Server 2008 R2 is available only in 64-bit editions.

Version Limit in 64-bit Windows
Windows Server 2008 R2 Datacenter 2 TB
Windows Server 2008 R2 Enterprise 2 TB
Windows Server 2008 R2 for Itanium-Based Systems 2 TB
Windows Server 2008 R2 Foundation 8 GB
Windows Server 2008 R2 Standard 32 GB
Windows HPC Server 2008 R2 128 GB
Windows Web Server 2008 R2 32 GB

Physical Memory Limits: Windows Server 2008

The following table specifies the limits on physical memory for Windows Server 2008. Limits greater than 4 GB for 32-bit Windows assume that PAE is enabled.

Version Limit in 32-bit Windows Limit in 64-bit Windows
Windows Server 2008 Datacenter 64 GB 2 TB
Windows Server 2008 Enterprise 64 GB 2 TB
Windows Server 2008 HPC Edition Not applicable 128 GB
Windows Server 2008 Standard 4 GB 32 GB
Windows Server 2008 for Itanium-Based Systems Not applicable 2 TB
Windows Small Business Server 2008 4 GB 32 GB
Windows Web Server 2008 4 GB 32 GB

Physical Memory Limits: Windows Vista

The following table specifies the limits on physical memory for Windows Vista.

Version Limit in 32-bit Windows Limit in 64-bit Windows
Windows Vista Ultimate 4 GB 128 GB
Windows Vista Enterprise 4 GB 128 GB
Windows Vista Business 4 GB 128 GB
Windows Vista Home Premium 4 GB 16 GB
Windows Vista Home Basic 4 GB 8 GB
Windows Vista Starter 1 GB Not applicable

Physical Memory Limits: Windows Home Server

Windows Home Server is available only in a 32-bit edition. The physical memory limit is 4 GB.

Physical Memory Limits: Windows Server 2003

The following table specifies the limits on physical memory for Windows Server 2003. Limits over 4 GB for 32-bit Windows assume that PAE is enabled.

Version Limit in 32-bit Windows Limit in 64-bit Windows
Windows Server 2003 with Service Pack 2 (SP2), Datacenter Edition 128 GB

64 GB with 4GT

2 TB
Windows Server 2003 with Service Pack 2 (SP2), Enterprise Edition 64 GB 2 TB
Windows Storage Server 2003, Enterprise Edition 8 GB Not applicable
Windows Storage Server 2003 4 GB Not applicable
Windows Server 2003 R2 Datacenter Edition

Windows Server 2003 with Service Pack 1 (SP1), Datacenter Edition

128 GB

16 GB with 4GT

1 TB
Windows Server 2003 R2 Enterprise Edition

Windows Server 2003 with Service Pack 1 (SP1), Enterprise Edition

64 GB

16 GB with 4GT

1 TB
Windows Server 2003 R2 Standard Edition

Windows Server 2003, Standard Edition SP1

Windows Server 2003, Standard Edition SP2

4 GB 32 GB
Windows Server 2003, Datacenter Edition 128 GB

16 GB with 4GT

512 GB
Windows Server 2003, Enterprise Edition 32 GB

16 GB with 4GT

64 GB
Windows Server 2003, Standard Edition 4 GB 16 GB
Windows Server 2003, Web Edition 2 GB Not applicable
Windows Small Business Server 2003 4 GB Not applicable
Windows Compute Cluster Server 2003 Not applicable 32 GB

Physical Memory Limits: Windows XP

The following table specifies the limits on physical memory for Windows XP.

Version Limit in 32-bit Windows Limit in 64-bit Windows
Windows XP 4 GB 128 GB
Windows XP Starter Edition 512 MB Not applicable

Physical Memory Limits: Windows 2000

The following table specifies the limits on physical memory for Windows 2000.

Version Limit in 32-bit Windows
Windows 2000 Professional 4 GB
Windows 2000 Server 4 GB
Windows 2000 Advanced Server 8 GB
Windows 2000 Datacenter Server 32 GB

Put an Online – Offline Yahoo Messenger button on your website

If you run an online business like an e-store or something similar you might want to show a button showing if your are available to chat via Yahoo Messenger.

This is a fairly easy job to do. All you have to do is to show this code somewhere on your site:
[ccNe_html]
<a href=”ymsgr:sendIM?YOUR_YM_ID”>
<img src=”http://opi.yahoo.com/online?u=YOUR_YM_ID&m=g&t=1″ border=”0″ alt=”” /> </a>
[/ccNe_html]
Remember to replace  YOUR_YM_ID with your Yahoo Messenger id and give t a value reflecting the button choice you like:

t=0
t=1
t=2
t=5

List of open dns servers

This is a growing list of Open DNS servers available around the world.

I also maintain a list of ip address of various isp providers.

Google Pubic DNS

  • 8.8.8.8
  • 8.8.4.4

OpenDNS

  • 208.67.220.220
  • 208.67.222.222.

Open DNS also makes available a third and fourth dns server with identical service to the first two:

  • 208.67.220.222
  • 208.67.222.220

ScrubIT

  • 67.138.54.100
  • 207.225.209.66

Level 3 Communications

  • 4.2.2.1
  • 4.2.2.2
  • 4.2.2.3
  • 4.2.2.4
  • 4.2.2.5
  • 4.2.2.6

OpenNIC

  • 58.6.115.42 (Queensland, Australia)
  • 202.83.95.227 (Queensland, Australia)
  • 119.31.230.42 (Victoria, Australia)
  • 217.79.186.148 (Germany)
  • 27.110.120.30 (New Zealand)
  • 89.16.173.11 (United Kingdom)
  • 216.87.84.211 (Colorado, United States)
  • 2001:470:8388:10:0:100:53:20 (Colorado, United States)
  • 69.164.208.50 (New Jersey, United States)
  • 69.164.211.225 (New Jersey, United States)
  • 64.0.55.201 (New York, United States)
  • 66.244.95.20 (Indiana, United States)
  • 2001:470:1f10:c6::2 (Indiana, United States)
  • 72.14.189.120 (Texas, United States)
  • 2001:470:1f0f:48e::2 new (Texas, United States)
  • 69.164.196.21 (Texas, United States)

Error getting the post list – Maemo WordPy

Today I tried again installing and configuring WordPy for Maemo on my Nokia N800 internet tablet. Since I can blog from my mobile phone I wanted to have a wordpress blog client on my tablet as well.

I configured everything correctly but I kept getting the Error getting the post list” message everytime I wanted to refresh the posts list. I browsed the forum, tried everything than  I realized the only difference between configurations posted on the forum and mine: http:// was missing from my Blog URL field in the configuration.

That is all that was needed. The post list appeared and I can now post from my Nokia Internet Tablet too. Actually I could do it for a long time, since WordPy is available from the times of the 770 tablet.

Have fun.

Your graphic drivers are written for an older version of windows

I installed windows xp maybe thousands of times and yet this is a new one. A client of mine has custom install cd’s that are Windows XP SP3 and include NVidia Graphics Drivers. All good and nice but they wanted to have the latest NVidia Graphic Drivers so I went on and downloaded the latest drivers and installed them.
After reboot Windows greeted me with an ugly face in 640x480x16 colors. Going to the Display Properties cleared the problem a bit. The error said something like “Your Graphic Drivers are made for an older version of Windows”.

Gee, you don’t say.

I tried uninstalling and installing again but to no effect. What did work surprised me. The solution is to install the driver TWICE.

Yes, dear windows user, twice. I don’t have an explanation and it works. Confirmed by the fact that I stumbled a few days ago on the same problem on a computer running Windows XP, SP3 with an ATI 4650 graphics card for which the owner installed the graphic drivers that came on the manufacturer’s CD. Again, updating those required to install the new drivers twice.