Category Archives: bash

building custom debian-live images

This is how I got a working USB bootable image with a custom debian-live image.
This tool is very usefull to test hardware support and for rescue.

= debian packages to install =
* live-config
* live-build
* live-boot
not mandatory
* live-tools
* live-manual
= frist try =
* create a directory
* get root permissions
* lb config
* lb build

= files you can edit for fine tuning =
* vim config/chroot
*: LB_LINUX_FLAVOURS=”686″
* vim config/bootstrap
*:LB_ARCHITECTURE=”i386″
This will build a rom for 32bit _even_ if you use a 64bit unit to build
* vim config/chroot
*: LB_PACKAGES=”python”
to add pacakges to install

= second try =
* lb clean –purge –binary
* be sure to edit the files mentioned on previous section
* lb config
* lb build

= how to put code on it? =
~/config/chroot_local-includes/ will be the root of the filesystem
you can try adding
~/config/chroot_local-includes/sur/local/bin/hello-word.sh

mounting a remote filesystem with sshfs

using debian wheezy:
– prerequisites:
– a working ssh server on a remote unit
– an ssh client on the local unit

as root, on local unit

# apt-get install fuse-utils sshfs
# adduser [your-user] fuse

now as [your-user]

$ groups | grep fuse
if this doesn't works, logout, at next login, check again
$ mkdir [sshfs-mountpoint]
$sshfs -p [port] [remote-user]@[remote-unit]:[/path] [sshfs-mountpoint]

This could be quite useful:

fusermount -u [sshfs-mountpoint]

source

bash with colors

have fun:


#!/bin/bash

# attribute codes
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# text color codes
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# background color codes
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white

green='\e[0;32m'
blue='\e[0;34m'
red='\e[0;31m'
endColor='\e[0m'

boldGreen='\e[1;32m'
boldBlue='\e[1;34m'
boldRed='\e[1;31m'
endBoldColor='\e[1m'

# Display welcome message
#echo -e "${green}Welcome \e[5;32;47m $USER \n${endColor}"
colour=$1
case $colour in
blue*)
colour=$blue;;
red*)
colour=$red;;
green*)
colour=$green;;
*)
echo -e "Usage: specify ${boldGreen}green${endBoldColor},${boldBlue} blue ${endBoldColor}or ${boldRed}red${endBoldColor}."
exit 0
esac
echo -e "${colour}Welcome \e[5;32;47m $USER \n${endColor}"

source

building mplayer2 in debian

apt-get install libxv-dev libasound2-dev libfreetype6-dev libfontconfig1-dev
apt-get install libavutil-dev libavcodec-dev libavformat-dev libswscale-dev libpostproc-dev
apt-get install autotools-dev automake autoconf yasm

git clone git://git.mplayer2.org/mplayer2-build.git
./init –shallow
./update
./make -j 6
(apt-get remove mplayer)
(make install)

—–
after a few weeks playing with mlayer2 I’ve decided to upgrade the repository:
./update
gave me the following error:

tatico@tortuguita:~/codigo/mplayer2-build$ ./update
Updating 90e07b3..5079c04
error: Your local changes to the following files would be overwritten by merge:
README
Please, commit your changes or stash them before you can merge.
Aborting

so I did a:

tatico@tortuguita:~/codigo/mplayer2-build$ git checkout -- README

then ./update worked!

squirrelmail with postfix – debian

apt-get install courier-imap
http://www.debian-administration.org/articles/243

Thing 1:

http://www.squirrelmail.org/docs/admin/admin-3.html

Thing 2:
/usr/share/squirrelmail/config/conf.pl