Monthly Archives: July 2011

Install samba on debian and connect with windows 7

  1. Install samba with ‘apt-get install samba’
  2. Follow the install wizard and enter ‘workgroup’ and if you use a dhcp server
  3. Add a directory for samba shares. ‘mkdir /samba
  4. Add a usergroup for samba. ‘groupadd sambauser’
  5. Give directory to the group. ‘chgrp sambauser /samba’
  6. Change the rights. ‘chmod 770 /samba’
  7. Add a user. ‘useradd -g sambauser windowsclient’
  8. Give the user a password. ‘passwd windowsclient
  9. Add samba password, make it the same as the linux user password. ‘smbpasswd -a windowslcient’
  10. Enable user in samba. ‘smbpasswd -e windowsclient’
  11. Add the following to /etc/samba/smb.conf

      [MyShare]
      path = /samba
      writable = yes
      public = no
      valid users = windowsclient
      force create mode = 0770
      force directory mode = 0770
  12. Restart samba with /etc/init./samba restart’.

Now you should see your server under network on the windows system and can connect using the account windowsclient / password.

Debian 5.0 (lenny) on NSLU2

I had this old Cisco NSLU2 around, doing nothing other than bringing an even older USB HDD to the network. And i honestly never really used it, because the truth is, the NSLU2 is slow.

So i found this great site where they explain how to flash Linux on the device some time ago. And now, after having to set up a few Debian server and no reasonable way to hide from it, i decided to put a Debian on the NSLU2.

The instructions are quite simple as the device is supported by Debian 5.0.

Some advice from personal experience:

  • Use a singe 2,5” (notebook) USB drive. With 2 drives, powered over USB, you might get problems with the power supply. One works great for me.
  • Expect to spend up to 3 hours on this. Without playing, just installing and configuration.
  • Do not expect the NSLU2 to perform like a computer or vps. It is slow, but its performance positively surprised me.
  • Use the provided unofficial image.

Execute batch script on windows 7 logout or login

Sorry, used a german windows version for the screenshots. I am currently on holiday and had to use this version. Will change them next week.

A useful addition to the robocopy backupscript is an automatic execution at specific events. Like on login or logout or system startup.

To configure this you need to edit the group policies. Press start and enter gpedit.msc.

GPEDIT.MSC

Start gpedit.msc

Next you navigate to the user configuration -> windows settings -> scripts section in the application.

Double click on the event you would like to trigger your script. Like logout for example.

GPEDIT.MSC Screen

GPEDIT.MSC Screen

Select your script, in my case backup.bat. Copy the file to the destination shown when you press the button ‘files’.

You might want to activate under admin-templates -> system -> scripts  the output for your script, so you know what your computer is doing.

Nice icons

Wget quick howto: Examples for the most common uses

If you are using linux on your computer or operate your own (virtual-)server you will likely be faced with the problem to transfer data from an other computer/server to your own.

wget is a little linux tool that i usually in a standard installation. Here are a few examples for the most common uses. If you need a more in-depth explanation, please consult the man pages.

Getting a single file from remote location:

Specify the number of downloads attempts:

Continue a interrupted download:

Login credentials needed? No problem:

Download a webpage or something else recursive:

Want to download all pictures from a list of websites?

  • -A jpg,gif,png,bmp,jpeg specifies a acceptlist of file extensions.
  • -i filename to specify a file with the websites
  • -q suppresses messages to the console
  • wget -i mylist.txt -A jpg,gif,png,bmp,jpeg -q -r -l 10
%d bloggers like this: