Apache
Apache official site
Generating SSL sertificate for Apache – self signed
Generating again…
Mplayer config file
softvol=yes # sound volume – lvl up #
softvol-max=500 # sound volume – lvl up #
ass=yes # OSD fonts #
ass-font-scale=1.5 # font size #
ass-use-margins=yes
#ass-bottom-margin=50 # make black line under the film – 50px#
ass-color=FFFFFE00 # font colors and transparancy #
fontconfig=yes # for encoding opts #
subcp=cp1251
Burn UDF/ISO DVD - terminal
growisofs -speed=4 -Z /dev/<dvd character device> -udf <directory to burn>
RECOVER Mysql root password
Here is a good link to change mysql root password if you have root access to the machine:
The fastest way to change it (debian based):
create sql that changes the password – sometginh like this:
file= “/tmp/file-$$.sql”
echo “SET PASSWORD FOR root@localhost = PASSWORD(‘NEW ROOT PASS’);” > $file
/etc/init.d/mysql stop
mysqld_safe –init-file=$file &
killall -9 mysqld_safe
/etc/init.d/mysql start
Some additional links:
recoever mysql root pass
recoever mysql root pass (long explanation)
recoever 3 choice – more variants
WIRELESS devices in linux
All for wireless in linux – supported by HP (good source)
The Linux Wireless WiKi – nice (supported modes for the diferent drivers)
ipw2200-ap – special driver to make AP from intel ipw2200 wifi card
also GOOD site to check about compatibility on any card/chip
build AP basics / build secure AP.. + basics again / have to read this too (no wpaX) / IBM Developers help on buliding AP
PostGres proccess list + OPTIMIZE
SELECT p.procpid, p.usename, p.datname, p.query_start, p.backend_start, p.client_addr, p.current_query
FROM pg_stat_activity AS p;
Optmize Postgres 8.x
# create new table space in different location – better on diferent disk
CREATE TABLESPACE ts_name LOCATION ‘
# find indexes of the tabe
SELECT relname, relkind, reltuples, relpages FROM pg_class where relname like ‘table_name%’ AND relkind like ‘i’;
# change the user tablespace ( do for tables and index tables )
ALTER TABLE table_name SET TABLESPACE new_tablespace
nice explained performance tunning tips
postgresql documentation about configuration
USB boot from GRUB
in the grub console write this (note that you have autocompleet):
> root (hd,…)
> kernel /casper/vmlinuz file=preseed/kubuntu.seed boot=casper ramdisk_size=1048576 root=/dev/ram rw quiet splash
> initrd /casper/initrd.gz
> boot
View webPage From console
page body:
wget -qO – <URL>
curl <URL>
headers:
wget -S <URL>
curl -I <URL>
Пощенски кодове
Младост 1а – 1729
Дружба 2 – 1582
Добавяне на мрежов маршрут
Добавяне на мрежа
route add -net <net ip> netmask <mask> gw <gateway ip for this route> <interface>
Добавяне на хост
route add -host <host ip> gw <gateway ip for this route> <interface>
Разглеждане и убиване на postgresql заявки
Да кажем че базата се казва dbase -
Разглеждане на заявката:
psql -U postgres dbase -c “SELECT datname,procpid,query_start,current_query FROM pg_stat_activity;”
Колоната procpid е с номера на заявките – той се изполва при убиването. Да кажем че процеса е с pid номер 20128:
psql -U postgres dbase -c “SELECT * FROM pg_cancel_backend(20128); “
Mencoder to x264 and 2 pass
average bitrate
mencoder “source.avi” -ovc x264 -x264encopts bitrate=1000:pass=1:threads=3:qp_min=1:qp_max=40:turbo=1 -oac copy -o /dev/null
mencoder “source.avi” -ovc x264 -x264encopts bitrate=1000:pass=2:threads=3:qp_min=1:qp_max=40 -oac copy -o “autput.avi”
ref:
http://web.njit.edu/all_topics/Prog_Lang_Docs/html/mplayer/encoding.html
Change pass. in MySQL
mysqladmin -u root -p [oldpassword] [newpass]
Create MySQL User
GRANT ALL ON database.* TO user@localhost IDENTIFIED BY “password”;
FLUSH PRIVILEGES;
Dump/Insert MySQL db
bash> mysqldump -u root -p [database name] >file.sql ## dump dhe database
mysql> create database [database name]; ## create the database
mysql> use [database name]; ## select the database
mysql> source file.sql; ## import the database
Recover MySQL table
bash> mysql -p
mysql> use [database name];
mysql> REPAIR TABLE xxxx USE_FRM;
Update the freeBSD ports
cd /usr/ports
cvsup -g -L2 /etc/supfile.ports
Search in freeBSD ports
cd /usr/ports
make fetchindex
make search name=[some name]
Archive things
Extracting single file from archive (FreeBSD tested)
tar -xvzf [archive] [full path to file in archive]
Upgreading spamassassin
sa-learn -D –mbox –spam [mbox file with spam] 1> spam.log 2>&1
Pipe all to LOG in bash
<command> 1> <log file> 2>&1
SSH tunneling
from the LAN host:
bash>ssh -N -f -R [new port on REAL-IP]:localhost:22 -l [REAL-IP user] [REAL-IP]
then on a computer anyware in the world:
connect on the REAL-IP computer
bash>ssh -l [LAN computer user] -p [new port on REAL-IP] localhost
Extract from coc archive
mencoder [file name].mov -o [oudio output].mp3 -oac lavc -lavcopts acodec=mp3:abitrate=64 -ovc frameno
