Login form



Linux How to: questions- answers
question_en: How to list wifi networks?
question_lt: Komandų eilutės įrankis prieinamiems wifi tinklams išvardinti?

answer_en:
iwlist <interface> scan
1) siwscan - set scan - only for root.
2) giwscan - for simple user.

answer_lt:
iwlist <interface> scan
1) siwscan - set scan - inicijuoja skenavimą. Leidžiama tik root.
2) giwscan - get scan - gražina scan rezultatus (dazniausiai is scan
cache). Šitas leidžiama eiliniam user'iui.


question_en:
How to check bad filesystem?
question_lt: Kaip patikrinti blogą failų sistemą?

answer_en:
Make image with dd conv=noerror. Or dd_rescue (or ddrescue). Then fsck -b 8193 -c ... or  fsck -p -c -f /dev/sdb1. Or
tune2fs -f -O ^has_journal /dev/... , then with fsck. ddrescue writes zero when is not able to read, not killing FS. With dd zeroes use conv=noerror,sync.

answer_lt:
Pasidarykite image su dd conv=noerror.  Arba dd_rescue (arba ddrescue). Tada fsck -b 8193 -c ... ar  fsck -p -c -f /dev/sdb1. Arba
tune2fs -f -O ^has_journal /dev/... ,o po to fsck. ddrescue surašo nulius kur nenuskaito, ir taip ko gero, nesugadina FS. Jei norisi, kad dd užpildytu nuliais nenuskaitomus blokus, reikia naudoti conv=noerror,sync.

question_en:
How to kill list of processes?
question_lt: Kaip užbaigti procesų sąraša?

answer_en:
same as below

answer_lt:

kill `ps aux | grep progname | awk '{print $2}'`
pidof <program_name>
for i in `ps aux | grep progname | awk '{print $2}'`; do kill $i; done
for i in $(ps aux | grep progname | awk '{print $2}');do kill -9 $i;done
fuser -k
pkill progname
cat list-of-pids-to-murder-muahahahaha.txt | xargs kill
kill `cat list-of-pids-to-murder-muahahahaha.txt`
killall -9 prog_name
pkill [-signalas] -f progname
for list-  ps aux | awk '/X/ {print $2}'
kill `ps aux | grep progname | awk '{print $2}'`


question_en:
How to launch few screens in text terminal (putty)?
question_lt: Kaip pakeisti kelis darbo langus tekstiniame terninale?

answer_en:
same as below

answer_lt:

apt-get install screen
screen
CTRL-A c for new screen
CTRL-A  n back to top
CTRL-A K kill screen
screen -ls show screens info



question_en:
How to rename lots of files according some order?
question_lt: Kaip iš eilės pervadinti failus?

answer_en:
same as below

answer_lt:

for file in *.jpg; do mv -i $file $((++i)).jpg; done

for SENAS in *.jpg; do
NAUJAS=`echo $SENAS | sed -e 's/IMG_//'`
mv ${SENAS} ${NAUJAS}
done

learn renameutils.


question_en:
Debian, how to know last apt-get upgrade?
question_lt: Kaip sužinoti, kada buvo paskutinis apt-get upgrade?

answer_en:
same as below

answer_lt:

grep 'status installed' /var/log/dpkg.log | tail -n1 | cut -d' ' -f1-2
or
goto /var/cache/apt/archives/ and explore files.



question_en:
How to convert filenames from one coding to another?
question_lt: Kaip išsaugoti vienos koduotės failų vardus į kitą?

answer_en:
same as below

answer_lt:

convmv
apt-cache show convmv


question_en: What program can we use for administering servers?
question_lt: Kokias programas, priemones naudoti serverių administravimui, inventorizacijai konfigūracijų valdymui, monitoringui?

answer_en:
same as below

answer_lt:

Nagios, Puppet, Zabbix.



question_en:
How to know, what process is using my disc?
question_lt: Kaip pasižiūrėt, koks procesas naudoja hardą.?

answer_en:
iotop
atop
or  /proc/sys/vm switch on, kernel will write pids to syslog .
pidus į syslogą rašys.

answer_lt:

iotop
atop
or  /proc/sys/vm įjungti, kernelis pidus į syslogą rašys.



question_en: How to know, what process is using my disc?
question_lt: Kaip pasižiūrėt, koks procesas naudoja hardą.?

answer_en:
iotop
atop
or  /proc/sys/vm switch on, kernel will write pids to syslog .
pidus į syslogą rašys.

answer_lt:

iotop
atop
or  /proc/sys/vm įjungti, kernelis pidus į syslogą rašys.



question_en:
Problems with dhcp client in Debian?
question_lt: Problemos su Debian dhcp klientu?

answer_en:
Debian standart DHCP client doesnt work sometimes. Use PUMP.

answer_lt:

Pasirodo Debian standartinis DHCP klientas kartais netinka. Rekomenduojamas PUMP.



question_en:
What toll is used to check SMART disks?
question_lt:
Kokia priemonė naudojama tikrinti SMART diskus?.

answer_en:
smartctl

answer_lt:
Tas pat.



question_en:
smartctl -a /dev/simfs
Smartctl open device: /dev/simfs failed: Permission denied
question_lt: Tas pat.

answer_en:
chmod +r /dev/simfs didn't help

answer_lt:
Tas pat.



question_en:


$ ls -alF back
ls: .... back: No such file or directory
$ mkdir back
mkdir: ....: File exists

question_lt: Tas pat.



answer_en:

Problem with links. Solution- delete link:

$ ln -s unexisting back
$ ls -alF back
lrwxrwxrwx 1 akompanas users 9 Apr 21 10:39 back -> unexisting
$ ls -alF back/
ls: cannot access back/: No such file or directory
$ mkdir back
mkdir: cannot create directory `back': File exists

Problem with dublicated UUID. Solution for XFS:

xfs_admin -U generate /dev/sdb7
Clearing log and setting UUID
writing all SBs
new UUID = 01fbb5f2-1ee0-4cce-94fc-024efb3cd3a4

answer_lt:

Problemos su nuorodomis. Sprendimas- trinti nuorodą:

$ ln -s unexisting back
$ ls -alF back
lrwxrwxrwx 1 akompanas users 9 Apr 21 10:39 back -> unexisting
$ ls -alF back/
ls: cannot access back/: No such file or directory
$ mkdir back
mkdir: cannot create directory `back': File exists

Problemos su dublikuotu UUID. Sprendimas  XFS:

xfs_admin -U generate /dev/sdb7
Clearing log and setting UUID
writing all SBs
new UUID = 01fbb5f2-1ee0-4cce-94fc-024efb3cd3a4



question_en:
Some program is working wrongly. What to do?
question_lt: Programa dirba klaidingai, ką daryti?.

answer_en:

strace progName

answer_lt:

Tas pat.



question_en: Why output of  fdisk and df are different?
question_lt:
Kodėl skirtingai išveda onformaciją df ir fdisk?

root@pc:/# fdisk -l | grep /dev/sdb1
/dev/sdb1               1        4998    40146403+  83  Linux


root@pc:/# df | grep /dev/sdb1
/dev/sdb1             18919964    176216  17782664   1% /mnt/40

answer_en:

Blocks 512 kb instead of 1024 kb. Use:
dumpe2fs /dev/sdb1 | egrep 'Block size|Block count' to konow more.
or additionaly use blockdev command.
answer_lt:

Skirtingi blokai: padės aukščiau esanti informacija.



question_en: What is squidguard?
question_lt:
Kas yra Squidguard?

answer_en:

SquidGuard is a URL redirector used to use blacklists with the proxysoftware Squid. There are two big advantages to squidguard: it is fast and it is free. SquidGuard is published under GNU Public License.

answer_lt:

Tas pat.



question_en: Somebody is using 85 port, how to know, who?
question_lt:
Kažkas naudoja 85 portą, kas tai?

answer_en:

netstat -nlp | grep :85

answer_lt:

Tas pat.



question_en: How to know , is computer active in your local network?
question_lt:
Kaip sužinoti, ar kompiuteris aktyvus lokaliame tinkle?

answer_en:

arping, it uses not  ICMP protocol, but  ARP.

answer_lt:

arping, naudoja ne ICMP protokolą, o ARP.



 
[ BBC news ][ Yahoo news ][ Linux guru ][ Webmaster ACE ]