Free disk space by finding big files

Here you can find some useful application to look for big files on disk for Windows and Linux. These disk tools are all free software, and very useful to find big files on disk and free disk space.

On Windows: WinDirStat

  • Download and install WinDirStat
  • Run WinDirStat on your disks (it will take time)
  • You’ll see a coloured map of file occupation by file type

windirstat

On Linux command line: ncdu

  • On Ubuntu / Debian
    • apt-get install ncdu
    • cd /dir/to/check
    • ncdu
  • On CentOS / Fedora / RedHat
    • yum install ncdu
    • cd /dir/to/check
    • ncdu
ncdu-screenshot

ncdu screenshot by dev.yorhel.nl: Official Website

Press c to show the number of files / directories contained inside each directory, and C to sort them for number of items, pressing ? will show all available shortcuts.

On Linux with window manager

  • CentOS / Fedora / RedHat
    • yum install k4dirstat
  • On Ubuntu / Debian
    • apt-get install k4dirstat

Again, you’ll see a coloured map of file occupation by file type.

Official website

 

dirstat1-yuenhoe

Screenshot by yuenhoe.com

Turn Raspberry into a small NAS with samba

I got a Raspberry Pi Model B. It’s cheap and I want to do some experiments for fun.

Experiment #1: I have a 1T external HDD (FAT) and I want to turn Raspberry into a very basic NAS.

I used:

  • 1 External USB HDD (with external power supply)
  • 1 ethernet cable CAT. 5 (10/100) or better
  • 1 HDMI cable and monitor / tv
  • 1 smartphone microusb battery charger
  • 1 SDHC (for the OS)
  • Raspbian “wheezy” (tested on 2012-08-16 release)
  • 1 modem router for connectivity (4 port)
  • 1 Windows PC plugged to the router

I flashed Raspbian into a class 10 SDHC, I follow this useful howto about to turn on HDMI instead of TV and voilà, I got a down-scaled debian system into a silent, little board that I charge with the smartphone charger via microusb (5V, 700mA).

I plug a wireless mouse and keyboard on the first USB port, and then I plug my external drive on the second. Debian read the FAT partition well (mounted on /media/MYDRIVE), but now I have to turn it into a wannabe-NAS.

Shall we dance? With Samba!

I plug the RJ-45 ethernet connector from my modem router into the Raspberry Pi and I follow this howto in Italian.

$ is a pi console (Start > Accessories > LXTerminal)
# is a root console (Start > Accessories > Root terminal)

# adduser guest --home=/home/public --shell=/bin/false --disabled-password
# sudo chmod -R 0700 /home/public
# chown -R guest.guest /home/public
$ sudo apt-get install samba smbfs

Then I have a new user “guest” with no password authentication. The howto covers the creation of a shared home (/home/public) but I do something slightly different (WORKGROUP is my local network name):

editing /etc/samba/smb.conf

## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP

####### Authentication #######
   security = share

   obey pam restrictions = yes
   guest account = guest
   invalid users = root

And now the most interesting part:

[MYDRIVE]
comment = Mydrive
read only = no
locking = no
path = /media/MYDRIVE
guest ok = yes
force user = pi

Where /media/MYDRIVE is the path to your external usb drive.

And then:

# /etc/init.d/samba restart

to apply.

As this howto explains, the “force user” allows a user (i.e. guest) to get the files from a device mounted by another user (i.e. pi, the default raspbian user).

Have fun

Now on the Windows machine on the Network panel I look for RASPBERRYPI and inside it I find the “mydrive” folder, with all the files from MYDRIVE within. I play a 720p video without slowdown. And so, the cheap NAS experiment is successfully completed.

Make Flash works with Chrome on Ubuntu 64 bit

  1. Download Chrome for Linux (64 bit .deb package)
  2. Install the package
  3. On shell type:
    $ sudo bash
    If you don’t have wget installed:
    # apt-get install wget
    # cd /opt/google/chrome/
    # mkdir plugins
  4. Get the latest experimental Flash Player “Square” on
    http://labs.adobe.com/technologies/flashplayer10/square/
    and then put it on Chrome plugins folder e.g.

    wget http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p3_64bit_linux_111710.tar.gz
  5. Close and restart Chrome: now Flash 10 is working.

See also:

Site off-line error after changing mysql to mysqli on Drupal

Sometimes Drupal try to access MySQL using a wrong socket, i.e. /tmp/mysql.sock.

There are two solutions: creating a symbolic link from the wrong location to the right location, or change the php.ini (es. /etc/php.ini) to point to the right socket:

mysqli.default_socket = /var/lib/mysql/mysql.sock

This solution is more reliable, since the symbolic link to socket should be recreated at any system boot on solution #1.

See also:

Howto extract tracks from mkv and avi

This howto requires:

  • mplayer
  • mkvtoolnix
  • your Linux box 😉

Audio from Avi files (es. Xvid + MP3):

mplayer -dumpaudio "mymovie.avi" -dumpfile mymovie_audio_track.mp3

Tracks from Matroska MKV file:

List all tracks:

mkvmerge -i mymovie.mkv

File 'mymovie.mkv': container: Matroska
Track ID 1: video (V_MS/VFW/FOURCC, XVID)
Track ID 2: audio (A_VORBIS)
Track ID 3: audio (A_VORBIS)
Track ID 4: subtitles (S_TEXT/UTF8)
Track ID 5: subtitles (S_TEXT/UTF8)

mkvextract tracks *.mkv 3:mymovie_audio_track.ogg 4:mymovie_subtitle.srt

Creates two files, mymovie_audio_track.ogg (track 3) and mymovie_subtitle.srt (track 4).

Howto merge *.001 to *.999 files on Linux

Someone give me some files named like this:

video.zip.001, …, video.zip.999

Initially I think these was some multipart zip files, but they aren’t.

Solution:

On your sudo / root shell type:

  • apt-get install lxsplit
  • lxsplit -j video.zip.001

This will install LX Split (a command line HJSplit version for Linux) found on debian-multimedia.org repository to open (and create) these multipart files.