Archive

Posts Tagged ‘ubuntu’

Convert m4a to mp3

June 5th, 2010 Albertux 1 comment

Convert m4a to mp3

Damn my iPod doesn’t support m4a audio files ( http://support.apple.com/kb/sp27 )

No problem:

sudo apt-get install faad
#!/bin/bash
IFS=$'\t\n'
EXTS=( m4a M4A m4A M4a )
for EXT in ${EXTS[@]};
do
	for f in `find . -name "*.$EXT" -type f`;
	do
		echo "Converting m4a to mp3 ..."
		faad -o - "$f" | lame - "${f%.m4a}.mp3"
		rm $f
	done
done

Yes the script is similar to this resize multiple images

Great tool to edit tags (http://easytag.sourceforge.net/)

sudo apt-get install easytag

Categories: multimedia, unix/linux Tags: , ,

Easy Backup Data Unix-Like

March 14th, 2010 Albertux No comments

Easy Backup Data Unix-Like

Some examples tested on Debian / Ubuntu

# Include .hidden_files (.svn/.git/etc...)
# copy dir on localhost
cp -a $SOME_PATH  $NEW_PATH
 
# apt-get install smbfs smbclient
# Samba remote to local
smbclient "//SOME_PLACE/SHARED FOLDER" -U $USER $PASS -c \
"cd \"$SOME_PATH\"; lcd \"$NEW_PATH\"; prompt; recurse; mget *; quit"
 
# wget -c "http://ossw.ibcl.at/FTPSync/ftpsync-latest.tar.bz2"
# User and Password on .netrc (chmod 600) [http://www.mavetju.org/unix/netrc.php]
# FTP remote to local
ftpsync -gv ftpserver=someserver.com  BackupWWW/ ftpdir=/www/
 
# SSH Copy File
scp $SOME_FILE $USER@$REMOTE:$SOME_PATH
# SSH Copy Dir
scp -r $SOME_PATH $USER@$REMOTE:$SOME_PATH
 
# apt-get install rsync
# Sync directories
rsync -v -u -a --delete --stats $SOME_PATH $BACKUP_PATH
 
# Backup System:
nc -lp $HOST > backup.tar.gz
tar cf - $DIR  | gzip  | nc -w 1 $HOST $PORT
 
# Clone disk to other disk (same host)
dd if=/dev/sdX of=$OUTPUT # (OUTPUT could be /dev/sdY or /some/path/disk.img)
 
# Clonning Hard Drive (other host)
nc -l -p $PORT | dd of=/dev/sda
dd if=/dev/sda | nc $HOST $PORT
 
# Date
NOW=`date +%h-%d-%Y-%H%M%S`
 
# Compress (z = gzip or j = bzip2)
tar cvzf $BACKUP_FILE-$NOW.tar.gz $SOME_PATH
 
# MySQL
mysqldump $DB -u $USER --password=$PASS | gzip -c > $DB-$NOW.sql.gz
# SQLite
echo '.dump' | sqlite3 $DB | gzip -c >$DB-$NOW.sql.gz
# PostgreSQL
# .pgpass (chmod 600)
pg_dump $DB | gzip -c > $DB-$NOW.sql.gz

Using crontab to run your backup(s) script(s)

Other stuff:

Amanda is a backup system that allows the administrator to set up a single master backup server to back up multiple hosts over network to tape drives/changers or disks or optical media.

DRBD refers to block devices designed as a building block to form high availability (HA) clusters. This is done by mirroring a whole block device via an assigned network. DRBD can be understood as network based raid-1.

Control Version Systems:
Subversion
Mercurial
Git

Are useful when you have different versions or configurations files.

Google Chrome OS

November 20th, 2009 Albertux No comments

Google Chrome OS

Google Chrome OS:

uname -a

Linux localhost 2.6.30-chromeos-intel-menlow #1 SMP Fri Nov 20 02:53:44 UTC 2009 i686 GNU/Linux

cat /etc/debian_version

squeeze/sid

dpkg -l

OUTPUT

lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 9.10 (development branch)
Release: 9.10
Codename: karmic

So full name:

Google Chrome OS (Cromium OS) – Ubuntu 9.10 Karmic Koala – Debian squeeze/sid 6.0 – Gnu/Linux

JSON File with Google Chrome settings:

/home/chronos/[user@gmail.com]/.config/google-chrome/Local State

Links:

Build Chromium OS

Download Google Chrome OS Virtual Machine (VMware and VirtualBox)

  • Categories: multimedia, unix/linux, web Tags: , , , ,

    Ubuntu 9.10 for Web Developers

    November 7th, 2009 Albertux No comments

    Ubuntu 9.10 for Web Developers

    # LAMP (Linux, Apache, MySQL and PHP)
    sudo apt-get install apache2 mysql-server php5 php5-mysql
    # phpMyAdmin, choose apache
    sudo apt-get install phpmyadmin
    # PostgreSQL
    sudo apt-get install postgresql php5-pgsql pgadmin3
    # Opera
    sudo apt-get install libqt3-mt
    wget -c "http://get3.opera.com/pub/opera/linux/1001/final/en/i386/opera_10.01.4682.gcc4.qt3_i386.deb"
    sudo dpkg -i opera_10.01.4682.gcc4.qt3_i386.deb

    Login problems using pgAdminIII and PostgreSQL:
    http://www.ubuntugeek.com/howto-setup-database-server-with-postgresql-and-pgadmin3.html

    Categories: database, unix/linux, web Tags: ,

    Ubuntu 9.10 Beta

    October 3rd, 2009 Albertux No comments

    Ubuntu 9.10 Beta

    Today, I upgrade my Ubuntu 9.04 to 9.10 beta.

    Only I run “update-manager -d” and wait some time …

    Upgrade is so easy.

    Categories: unix/linux Tags: ,