[url=http://www.phpbb.com/]Visit phpBB![/url]
url link
May 4th, 2009useless crap out of windows
October 28th, 2008http://keskustelu.suomi24.fi/show.fcgi?category=108&conference=4500000000000301&posting=22000000012912575
raid
July 4th, 200821:42 < vmk>
http://www.mail-archive.com/linux-raid@vger.kernel.org/msg10637.html
21:42 < vmk> tosa tero on se mdadm –zero-superblock /dev/sdb1
21:44 < vmk> annant tuon mdadm –zero-superblock /dev/d_1
21:45 < vmk> annant tuon mdadm –zero-superblock /dev/sda1 ja /dev/sdc1
jne…
21:45 < vmk> mdadm –manage /dev/mdfoo –fail /dev/sdfoo
21:45 < vmk> mdadm –manage /dev/mdfoo –remove /dev/sdfoo
21:45 < vmk> mdadm –manage –stop /dev/mdfoo
21:45 < vmk> noistaki voi aolla jeesiä
21:46 < vmk> ja umounttaa ne viel
21:48 < vmk> jos ei lähe nii sitte http://dban.sourceforge.net/ ja tolla
wipee sen kerran nii johan pitäs pelittää
21:50 < vmk> tai shred -vfz -n 1 /dev/hda
21:50 < vmk> tai shred -vfz -n 1 /dev/sda
21:50 < vmk> tai shred -vfz -n 1 /dev/sdc
21:51 < vmk> tai dd if=/dev/zero of=/dev/sda
21:51 < vmk> mutta noissa kestää sitten
21:52 < vmk> tai jos tolla ensin sudo dd if=/dev/zero of=/dev/hda bs=521
count=1
21:52 < vmk> mutta tuokaan ei kai poista sitä superblockkia
21:53 < vmk> http://mirror.href.com/thestarman/asm/mbr/WIPE.html
21:55 < vmk> elä tätä ajakkaan hajoo koko paska kuitenkin tai dd
if=/dev/zero of=/dev/sda
21:57 < vmk> nojoo huomenna jatkuu
Some firewall and port commands in linux
July 3rd, 2008List iptables configuration:
iptables –list
check which process uses an open port:
fuser -n tcp 25
check which process has pid:
ps -p 7583
Atm I got firewall configured in ubuntu with lokkit, which is pain in the ass to use after initial installation. It writes fresh config every time the prog is used thus easily removin all firewall config you might have. For this reason I have decided to conf lokkit manually by editing firewall script at:
/etc/default/lokkit
and then restarting lokkit by:
/etc/init.d/lokkit restart
Restoring configuration in Debian/Ubuntu
June 24th, 2008dpkg-reconfigure
IP address check
June 2nd, 2008Linux: ip addr/ifconfig
Windows: ipconfig
Determine your kenrel version
May 15th, 2008uname -r
How to find out Ubuntu version
February 21st, 2008cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=6.10
DISTRIB_CODENAME=edgy
DISTRIB_DESCRIPTION="Ubuntu 6.10"
My bashrc
April 19th, 2007Here it is, so I won’t lose it next time my laptop crashes:
#===============================================================
#
# PERSONAL $HOME/.bashrc FILE for bash-2.05a (or later)
#
# Last modified: Tue Apr 15 20:32:34 CEST 2003
#
# This file is read (normally) by interactive shells only.
# Here is the place to define your aliases, functions and
# other interactive features like your prompt.
#
# This file was designed (originally) for Solaris but based
# on Redhat's default .bashrc file
# --> Modified for Linux.
# The majority of the code you'll find here is based on code found
# on Usenet (or internet).
# This bashrc file is a bit overcrowded - remember it is just
# just an example. Tailor it to your needs
#
#
#===============================================================
# --> Comments added by HOWTO author.
# --> And then edited again by ER ![]()
# --> and then again by veijo
#-----------------------------------
# Source global definitions (if any)
#-----------------------------------
if [ -f /etc/bashrc ]; then
. /etc/bashrc # --> Read /etc/bashrc, if present.
fi
#-------------------------------------------------------------
# Automatic setting of $DISPLAY (if not set already)
# This works for linux - your mileage may vary....
# The problem is that different types of terminals give
# different answers to 'who am i'......
# I have not found a 'universal' method yet
#-------------------------------------------------------------
function get_xserver ()
{
case $TERM in
xterm )
XSERVER=$(who am i | awk '{print $NF}' | tr -d ')''(' )
# Ane-Pieter Wieringa suggests the following alternative:
# I_AM=$(who am i)
# SERVER=${I_AM#*(}
# SERVER=${SERVER%*)}
XSERVER=${XSERVER%%:*}
;;
aterm | rxvt)
# find some code that works here.....
;;
esac
}
if [ -z ${DISPLAY:=""} ]; then
get_xserver
if [[ -z ${XSERVER} || ${XSERVER} == $(hostname) ||
${XSERVER} == "unix" ]]; then
DISPLAY=":0.0" # Display on local host
else
DISPLAY=${XSERVER}:0.0 # Display on remote host
fi
fi
export DISPLAY
#---------------
# Some settings
#---------------
set -o notify
set -o noclobber
set -o ignoreeof
set -o nounset
#set -o xtrace # Useful for debuging
# Enable options:
shopt -s cdspell
shopt -s cdable_vars
shopt -s checkhash
shopt -s checkwinsize
shopt -s mailwarn
shopt -s sourcepath
shopt -s no_empty_cmd_completion # bash>=2.04 only
shopt -s cmdhist
shopt -s histappend histreedit histverify
shopt -s extglob # Necessary for programmable completion
export TIMEFORMAT=$'\nreal %3R\tuser %3U\tsys %3S\tpcpu %P\n'
export HISTIGNORE="&:bg:fg:ll:h"
export HOSTFILE=$HOME/.hosts # Put a list of remote hosts in ~/.hosts
#-----------------------
# Greeting, motd etc...
#-----------------------
# Define some colors first:
red='\e[0;31m'
RED='\e[1;31m'
blue='\e[0;34m'
BLUE='\e[1;34m'
cyan='\e[0;36m'
CYAN='\e[1;36m'
NC='\e[0m' # No Color
# --> Nice. Has the same effect as using "ansi.sys" in DOS.
# Looks best on a black background.....
echo -e "${CYAN}This is BASH ${RED}${BASH_VERSION%.*}\
${CYAN} - DISPLAY on ${RED}$DISPLAY${NC}\n"
date
if [ -x /usr/games/fortune ]; then
/usr/games/fortune -s # makes our day a bit more fun.... ![]()
fi
function _exit() # function to run upon exit of shell
{
echo -e "${RED}Hasta la vista, baby${NC}"
}
trap _exit EXIT
#===============================================================
#
# ALIASES AND FUNCTIONS
#
# Arguably, some functions defined here are quite big
# (ie 'lowercase') but my workstation has 512Meg of RAM, so ...
# If you want to make this file smaller, these functions can
# be converted into scripts.
#
# Many functions were taken (almost) straight from the bash-2.04
# examples.
#
#===============================================================
#-------------------
# Personnal Aliases
#-------------------
# -> Prevents accidentally clobbering files.
alias mkdir='mkdir -p'
alias h='history'
alias j='jobs -l'
alias r='rlogin'
alias which='type -all'
alias ..='cd ..'
alias path='echo -e ${PATH//:/\\n}'
alias du='du -kh'
alias df='df -kTh'
# The 'ls' family (this assumes you use the GNU ls)
alias la='ls -Al' # show hidden files
alias ls='ls -hF --color' # add colors for filetype recognition
alias lx='ls -lXB' # sort by extension
alias lk='ls -lSr' # sort by size
alias lc='ls -lcr' # sort by change time
alias lu='ls -lur' # sort by access time
alias lr='ls -lR' # recursive ls
alias lt='ls -ltr' # sort by date
alias lm='ls -al |more' # pipe through 'more'
#for wget resuming
alias wget='wget -c'
#----------------
# a few fun ones
#----------------
# aliases...
alias top='xtitle Processes on $HOST && top'
#-----------------------------------
# File & strings related functions:
#-----------------------------------
function lowercase() # move filenames to lowercase
{
for file ; do
filename=${file##*/}
case "$filename" in
*/*) dirname==${file%/*} ;;
*) dirname=.;;
esac
nf=$(echo $filename | tr A-Z a-z)
newname="${dirname}/${nf}"
if [ "$nf" != "$filename" ]; then
mv "$file" "$newname"
echo "lowercase: $file --> $newname"
else
echo "lowercase: $file not changed."
fi
done
}
#-----------------------------------
# Process/system related functions:
#-----------------------------------
function my_ps()
{ ps $@ -u $USER -o pid,%cpu,%mem,bsdtime,command ; }
function pp()
{ my_ps f | awk '!/awk/ && $0~var' var=${1:-".*"} ; }
function ii() # get current host related info
{
echo -e "\nYou are logged on ${RED}$HOST"
echo -e "\nAdditionnal information:$NC " ; uname -a
echo -e "\n${RED}Users logged on:$NC " ; w -h
echo -e "\n${RED}Current date :$NC " ; date
echo -e "\n${RED}Machine stats :$NC " ; uptime
echo -e "\n${RED}Memory stats :$NC " ; free
my_ip 2>&- ;
echo -e "\n${RED}Local IP Address :$NC" ; echo ${MY_IP:-"Not connected"}
echo -e "\n${RED}ISP Address :$NC" ; echo ${MY_ISP:-"Not connected"}
echo
}
# Local Variables:
# mode:shell-script
# sh-shell:bash
# End:
ipod in linux….
January 10th, 2007Best program for mp3 transfer in my opinion is Dopi. It can handle cover art too if the image file is inside the mp3 folder and image name is cover.jpg. Dunno what is the maximum resolution but I guess at least 320×320 images will be displayed.
Here is info how to add videos to ipod in linux:
Adding Video files to the iPod
With the latest CVS version of gtkpod its possible to add video files just like every MP3 file. See here.
Creating Video files that actually work
I found this site. The command (slightly modified, see below):
ffmpeg -vcodec xvid -b 300 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ab 96 -i input_file.avi -s 320x240 -aspect 4:3 ipod_output.mpg
This creates videos that work fine with the iPod. I had some problems, though. Following command also works (thanks go here):
ffmpeg -i in.avi -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ab 192 -s 320x240 -aspect 4:3 out.mp4
For 16:9:
ffmpeg -i in.avi -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ab 192 -s 320x180 -aspect 16:9 out.mp4
Note: With firmware 1.2 (for games etc.) you can set the resolution to 640×480 (640×360 for 16:9) to have a better quality on the TV screen. As the resolution of the built in screen is 320×240 you will not get any advantage here.