Posts about info

2012-09-04 connecting a linux client to a QNAP's LDAP server

2012-03-16 Creating a bootable Debian USB flash drive on MacOsX

  • largely adapted from https://help.ubuntu.com/community/Installation/FromUSBStick#From_Mac_OSX
  • download the iso
    wget http://napoleon.acc.umu.se/debian-cd/6.0.4/i386/iso-cd/debian-6.0.4-i386-CD-1.iso # or http://debian.ens-cachan.fr/ftp/debian-cd/6.0.4/i386/iso-cd/debian-6.0.4-i386-xfce+lxde-CD-1.iso
    hdiutil convert -format UDRW -o target.img debian-6.0.4-i386-CD-1.iso
    mv target.img.dmg target.img
  • identify where is your USB stick
    diskutil list
  • unmount the USB stick
    diskutil unmountDisk /dev/disk2
  • write on the stick
    mv target.img.dmg target.img
    sudo dd if=target.img of=/dev/rdisk2 bs=1m
  • eject the USB stick
    diskutil eject /dev/disk2

2011-07-10 mounting filesystems using SSH

2011-07-12 11:51:19

install on ubuntu

  1. $ sudo apt-get install sshfs
    [sudo] password for toto:
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed
      sshfs
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 43.7 kB of archives.
    After this operation, 160 kB of additional disk space will be used.
    Get:1 http://gb.archive.ubuntu.com/ubuntu/ natty/main sshfs amd64 2.2-1build1 [43.7 kB]
    Fetched 43.7 kB in 0s (1,477 kB/s)
    Selecting previously deselected package sshfs.
    (Reading database ... 342224 files and directories currently installed.)
    Unpacking sshfs (from .../sshfs_2.2-1build1_amd64.deb) ...
    Processing triggers for man-db ...
    Setting up sshfs (2.2-1build1) ...
  2. $ sudo gpasswd -a $USER fuse
    Adding user toto to group fuse

install on macosx

  1. install http://code.google.com/p/macfuse
  2. follow http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS
  3. (!) on a 64 bits system, you have to install a proper version, follow http://superuser.com/questions/75332/is-truecrypt-macfuse-supported-on-snow-leopard-with-64-bit-kernel

using sshfs (mac and ubuntu)

  1. Create a mountpoint and give yourself ownership
    sudo mkdir /media/mount-name
    sudo chown your-username /media/mount-name
  2. Mount the filesystem
    sshfs remote-system-name:/remote-folder /media/mount-name
  3. Unmount the filesystem
    fusermount -u /media/mount-name

automating the process sshfs (mac and ubuntu)

  1. script to mount_cluster.sh :
    mkdir ~/spawn
    sshfs toto@server:~/spawn ~/spawn
  2. script to unmount umount_cluster.sh :
    fusermount -u  ~/spawn
    rmdir ~/spawn

2010-12-27 how to find stuff

  • the most simple command is locate :
    locate Python.h

    ; it is based on a database updated regulalry (most often daily).

  • the most powerful is find :
    # To find all files modified in ~/Sites three days ago:
    find ~/Sites -mtime 3
    # and 10 minutes ago:
    find ~/Sites -mmin 10
    #A time specified by -n means less than, while +n means more than.
    
    #To find all files in you home directory modified within the last week use:
    find ~ -mtime -7
    find ~ -newer last-backup.log
    
    # will find all files changed (or created) since last-backup.log was files larger than 2 megabytes (4000 of these 512 byte blocks):
    find ~ -size +4000
    find empty files% find . -empty

2008-12-05 duplicate files

2011-07-06 14:00:04

You may find yourself overwhelmed by files and in the need to keep the filesystem organized. If deleting is the best option, you may consider these 2 options:

Dupinator

Dupinator, tries to find duplicates and to report them in order to clean-up the organization of your files.

changelog

It works by:

  • launched via command line by passing a set of directories to be scanned
  • traverses all directories and groups all files by size
  • scans all sets of files of one size and checksums (md5) the first 1024 bytes
  • for all files that have the same checksum for the first 1024 bytes, checksums the whole file and collects together all real duplicates
  • deletes all duplicates of any one file, leaving the first encountered file as the one remaining copy