Windows 7 & Samba

Ran into a problem after upgrading my work desktop to Windows 7: I could not connect to some existing Samba shares. Now the Linux box is running RHEL 5 (Samba 3.0.33) and is not part of our Active Directory; neither is my newly install Windows 7 system. When I would try to connect to the shares, Windows response gave the impression that nothing was running. A quick check show that it was indeed running. I verified colleagues could connect. WTF?!

So next we move to the log files. This looks interesting:

read_data: read failure for 4 bytes to client 162.37.156.123. Error = Connection reset by peer

A quick googling revealed Windows 7 uses some new NTLM security settings which causes issues with older Samba setups. Changing Windows to use reduced security fixes it. Simply go to Control Panel > Administrative Tools > Local Security Policy then select Local Policies > Security Options. Change “Network security: LAN Manager authentication level” to “Send LM & NTLM responses” and “Minimum session security for NTLM SSP” -> uncheck: Require 128-bit encryption.

Tue Dec 20 2011 | The Geek Life, Uncategorized | No Comments
Tags:
Related Posts: Windows 7 Powersaving, Automatically backup thumb drive in Windows XP

Enforcing Linux Ownership/Permissions

With a combination of the group sticky bit and ACL’s we can enforce ownership and permissions of subdirectories and files.

chmod -R g+s /srv/shared
setfacl -R -d -m u::rwx,g::rwx,o::rx /srv/shared

Tue Jul 19 2011 | The Geek Life | No Comments
Tags: ,,
Related Posts: SAN Migration: The Linux Way, Linux FTP and virtual directories?!, Version Controlled Configs, Re: Version Controled Configs

Change gnome-screensaver background

Took me a while to find this.  Using XFCE at work but I like the look of gnome-screensaver versus Xubuntu’s default of xscreensaver.  Unfortuantley I’m lacking any ability to change the background in gnome-screensaver.  I found if you create/adjust /etc/gconf/gconf.xml.defaults/%gconf-tree.xml everythings good:

<?xml version="1.0"?>
<gconf>
  <dir name="desktop">
    <dir name="gnome">
      <dir name="background">
        <entry name="picture_filename" mtime="1296081104" type="string">
          <stringvalue>/usr/share/pixmaps/backgrounds/gnome/background-default.jpg</stringvalue>
        </entry>
      </dir>
    </dir>
  </dir>
</gconf>

Wed Feb 16 2011 | Everything Else | No Comments
Tags: ,,,
Related Posts: gnome on SPARC, finale, gnome on SPARC, gnome on SPARC, cont.

Oh My Darling

Clementine. Actually I think they took the fruit path, but either way it makes for a fine, Amarok-styled music application.  There’s a few features I would like to see still but for the most part, they have a great player that is still responsive with my large music collection.  Something Exaile can not handle.

Since its Qt based it offers native Windows, Linux and OSX compatibility. Give it a whirl!

Thu Jan 27 2011 | The Geek Life | No Comments
Tags: ,,
Related Posts: Ideas, Linux FTP and virtual directories?!

Remove comments with(out) leading spaces

In an effort to help my memory and maybe the Internet, here is how you can strip out comments with or without leading spaces from a file in GNU/Linux:

grep -v -e '^[ t]*#' -e ^$ dovecot.conf

Continue reading this entry »

Thu Jan 13 2011 | The Geek Life | No Comments
Tags: ,,,
Related Posts: ahh finally, anonymous comments!

Wiping GPT Partitions

Andy brought in his USB HDD which Windows was now having issues seeing his partitions.  XP was strangely reporting it as a GPT disk.  I happily plugged it up to one of our Linux servers in our test environment, copied all of his data off and proceeded to reformat it.  However, after recreating the paritions with fdisk, it was still complaining that it was a GPT disk.  So I zero out the beginning of the disk.  Looked at it again with fdisk -l and it still reports its GPT.  WTF?!

Turns out that GPT format offers a secondary location at the tail of the drive.  Just multiply the total number of cylinders by the total number of sectors to get your location to seek to.  Funny though if I had looked GPT up first on Wikipedia then I would have saw the illustration.  Instead we wasted a few minutes Googling.

All together it looks like:

dd if=/dev/zero of=/dev/sdp bs=512 count=1
dd if=/dev/zero of=/dev/sdp bs=512 seek=41929650

Mon Jan 10 2011 | The Geek Life | No Comments
Tags: ,,,,
Related Posts: Automatically backup thumb drive in Windows XP

SAN Migration: The Linux Way

For our internal Linux distribution mirror I needed to migrate the LUNs from one EMC Clariion to another.  To make matters worse, each Clariion is in a different VSAN — completely separate SAN fabric in the Cisco world.  We don’t have any EMC migration tools that I know of but don’t really need them anyways. We can do it all with Linux thanks to the pvmove command.

Now to be fair all of our servers have dual HBAs.  So taking advantage of this fact, I re-zoned one of the HBAs to the new storage.  Then setup the new LUNs and presented it to the server.  Now I couldn’t find any generic way of rescanning the fabric but the HP tools offer probe-luns (found in /opt/hp/hp_fibreutils).  This allowed me to avoid bouncing the server to see the new storage.

Next we setup the LUNs for use with LVM with pvcreate and add them to volume group with vgextend.  Then with pvmove we migrate the extents from the old PV(s) to the new one.  Now be aware this takes a while.  When complete we remove the old PV(s) using vgreduce and pvremove.

Once all this has been completed we are free of the old storage and running on the new.  And the best part is no outage!

All together it looks something like this:

pvcreate /dev/emcpower{e,f}
vgextend vg01 /dev/emcpower{e,f}
pvmove -v /dev/emcpowera /dev/emcpowere
pvmove -v /dev/emcpowerb /dev/emcpowerf
pvmove -v /dev/emcpowerc /dev/emcpowere
pvmove -v /dev/emcpowerd /dev/emcpowerf
vgreduce vg01 /dev/emcpower{a,b,c,d}
pvremove /dev/emcpower{a,b,c,d}

Wed Dec 8 2010 | The Geek Life | No Comments
Tags: ,,,
Related Posts: Server Migration, Linux FTP and virtual directories?!

flacsync patches

I’ve been using the very handy flacsync python script to handle transcoding my audio collection into M4A for my iPod.  Now with the Droid I’m not forced to use that format — although I probably will.  However, flacsync only supports M4A.  So I hacked support for Ogg Vorbis into it.  I also hacked in the ability to define an alternate destination directory and keep the original replaygain tags intact.

Enjoy!

Thu Jul 8 2010 | The Geek Life | No Comments
Tags:
Related Posts: No related posts.

Automatically backup thumb drive in Windows XP

Although the conficker virus made malicious use of the Autorun properties of thumb drives, this feature can be used for good!  Here’s how to use it to automatically synchronize directories and files on a USB thumb drive to a directory on your hard drive.

Software you’ll need:

We’ll use a Window’s batch script that will handle setting up the executing environment and launching.  Save the backupthumb.txt script to your USB disk, rename to backupthumb.cmd and tweak to your own needs.  By default the script will log everything to the logs directory on your USB disk.  See the rsync man page for all of the options available to you.

Next create the file that will tell rsync what files and directory to backup.  Just place the path to each file or directory on a separate line.  Using my script, the path is relative to the root of the USB disk and could look like:

data/accounts.kdb
docs/

Note the trailing slash which is important. Without it the files inside docs would NOT be backed up.  Also by default, rsync will not process the named paths in a recursive manner.  If you want it to, add –recursive as an argument to the rsync command in the script.

The next step is to create the autorun.inf file in the root of the USB disk with at least the following:

[autorun]
action=Backup Thumb Drive
open=binbackupthumb.cmd

The open parameter’s value is relative to the root of the thumb drive.  Here I assume you saved the script to the bin directory on your USB disk.  Please note that I had issues if I prefixed it with a slash.  You can also pimp out the USB disk’s display in My Computer by adding a few more parameters to the autorun.inf file:

icon=datacruzer.ico
label=Thumb Drive
shellbkup=Backup Thumb Drive
shellbkupcommand=binbackupthumb.cmd

This will use the cruzer.ico and label it Thumb Drive instead of the defaults.    It also adds a shell extension labeled “Backup Thumb Drive” which will execute our batch script when selected.  Handy to force a backup manually.  For the icon I just googled for cruzer icons and used ConvertICO.com to convert the PNG to ICO format.  If you’re like me and are lazy, you can just download the complete autorun.inf file.

If you stop at this point you will have an option in the Autoplay menu to “Backup Your Thumb Drive” when you insert your USB disk.  However our goal is to have it automatically perform the backup.  For this we need to use TweakUI to add a custom AutoPlay handler to launch our script.  Launch TweakUI and click on My Computer > AutoPlay > Handlers.  Click on the Create button.  For <description> type Backup Thumb Drive.  For <program name> type my backup script.  Then click on the Change Program… button and browse to the batch script.  Delete everything in the Args text box.  You can also set a custom icon to make it complete.  Again just use google to find something appropriate.

Then in My Computer, right click on your USB disk and select Properties.  On the AutoPlay tab, select Mixed content from the drop-down option box.  Change the action to Select an action to perform, and select our new Backup Thumb Drive option.  Lastly click the OK button.

And there you have it.  A nice and automatic backup method for your USB thumb drives.  Next up will be to show you how to replicate this in Linux.

Fri Oct 9 2009 | The Geek Life | 1 Comment
Tags: ,,,,,
Related Posts: Windows 7 Powersaving

Windows 7 Powersaving

After upgrading Renee’s computer with powersavings in mind, I enabled the more aggresive powersavings options in Windows 7 RC.  I also set it to sleep after 30 minutes of inactivity.  Much to my surprise, the system kept waking itself up after a few minutes of sleep.  WTF?!

I had suspected a device or the BIOS was the culprit.  The event log wasn’t any help; all it noted was Windows had went to sleep, then woke up.  Duh.  A quick Google search revealed a command line utility powercfg, which can help point you to the last device which woke the system.  By running powercfg -lastwake you can list the device which did just that.  Nice!

Now I have a very nice system that scales back the CPU speed when not needed, then sleeps when it makes sense.  Finally just like my Linux system! ;)

Sat Jul 25 2009 | The Geek Life | No Comments
Tags: ,,,
Related Posts: No related posts.

Navigation

Categories

Link Blog

Sites of Interest

Meta