Vai al sommario della pagina
 

Consigli e suggerimenti vari raccolti in Rete

Cpufreq speedstepping

The cpufreq speedstepping in the 2.6.10 kernel works fine (without any patch). However it boots up with the userspace cpufreq-govenor which means that it does not take command over the setting the cpu frequencies itself. A echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor on boot fixes this (I made a small init.d-script for this). You can check the current cpu-freq with cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq and you can tweak the ondemand governor by setting the values in /sys/devices/system/cpu/cpu0/cpufreq/ondemand (I haven’t though).

# cat /proc/cpuinfo

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 13
model name      : Intel(R) Pentium(R) M processor 1.70GHz
stepping        : 6
cpu MHz         : 1695.100
cache size      : 2048 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr mce cx8 sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe est tm2
bogomips        : 3358.72
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

give the available governors:

  • ondemand : kernel monitor cpu usage and decide which scale to use.
  • userspace : : This governor exports the available frequency information to the user level (through the /sys file system) and permits user-space control of the CPU frequency. All user-space dynamic CPU-frequency governors, which run as daemons and control the CPU speed, use this governor as their basis.
  • powersave : This governor keeps the CPU at the lowest possible frequency within a user-specified range.
  • performance : use the full capacity of the CPU, don’t save the battery.

To change the governor just use the echo command like this:

# echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

where you can replace performance by all governors available.

fonte: http://www.thinkwiki.org/wiki/How_to_make_use_of_Dynamic_Frequency_Scaling

per lo script init.d vedere Debian System V Init

Risalire al nome di un servizio dal numero della porta utilizzata

Se si vuole risalire al nome del servizio che utilizza uno specifico numero di porta, utilizzare lsof -i specificando il numero della porta (nr. 22 nell’esempio) ed il tipo di protocollo (es. TCP):

# lsof -i tcp:22

COMMAND  PID  USER   FD   TYPE DEVICE SIZE NODE NAME
ssh     5631 rbnet    3u  IPv4  17767       TCP xxxx:xxxxx->xxxx:ssh (ESTABLISHED)

E’ possibile passare al comando lsof indirizzi multipli (fino a 100), sempre premettendo ad ogni coppia protocollo:nr.porta l’opzione -i - esempio:

# lsof -i tcp:22 -i tcp:80

COMMAND    PID  USER   FD   TYPE DEVICE SIZE NODE NAME
firefox-b 4243 rbnet   24u  IPv4  19804       TCP xxx:xxxxx->151.1.xxx.xxx:www (ESTABLISHED)
ssh       5901 rbnet    3u  IPv4  19774       TCP xxxx:xxxxx->xxxx:ssh (ESTABLISHED)

fonte: http://forum.html.it/forum/showthread.php?s=&threadid=872697

Visualizzare lo spazio occupato dalle directory

Utilizzare il comando du:

rbnet@debian64:~$ time su -c "du -shc /*"
Password:
3,8M    /bin
14M     /boot
0       /cdrom
281K    /dev
34M     /emul
7,1M    /etc
672M    /home
0       /initrd
127M    /lib
0       /lib64
0       /media
0       /mnt
0       /opt
1,1G    /proc
3,1M    /root
5,0M    /sbin
0       /srv
0       /sys
36K     /tmp
1,7G    /usr
2,1G    /var
5,5G    totale

real    0m4.730s
user    0m0.215s
vsys     0m0.854s

Se si sono montano delle condivisioni NFS o partizioni separate è preferibile utilizzare df -k ed usare du solo per la parte restante del file system, velocizzando così l’elaborazione del comando.

fonte: http://forum.html.it/forum/showthread.php?s=&threadid=918018

Hardware check online

Eseguire il comando lspci -n in una console, es:

rbnet@mylinuxbox:~$ lspci -n

0000:00:00.0 0600: 10de:00e1 (rev a1)
0000:00:01.0 0601: 10de:00e0 (rev a2)
0000:00:01.1 0c05: 10de:00e4 (rev a1)
0000:00:02.0 0c03: 10de:00e7 (rev a1)
0000:00:02.1 0c03: 10de:00e7 (rev a1)
0000:00:02.2 0c03: 10de:00e8 (rev a2)
0000:00:05.0 0680: 10de:00df (rev a2)
0000:00:06.0 0401: 10de:00ea (rev a1)
0000:00:08.0 0101: 10de:00e5 (rev a2)
0000:00:09.0 0101: 10de:00ee (rev a2)
0000:00:0b.0 0604: 10de:00e2 (rev a2)
0000:00:0e.0 0604: 10de:00ed (rev a2)
0000:00:18.0 0600: 1022:1100
0000:00:18.1 0600: 1022:1101
0000:00:18.2 0600: 1022:1102
0000:00:18.3 0600: 1022:1103
0000:01:00.0 0300: 10de:0042 (rev a1)
0000:02:0c.0 0c00: 1106:3044 (rev 46)
0000:02:0d.0 0200: 10ec:8169 (rev 10)

Copiare l’output ed incollarlo nel sito http://kmuto.jp/debian/hcl/index.cgi

fonte: http://daniele.wordpress.com/2006/03/06/hardware-check/

Montare un'immagine ISO

Digitare il comando:

mount -o loop immagine.iso /mnt/dir_a_scelta/

Per maggiorni informazioni:

man mount

Catturare gli errori di Boot

Modificare il file:

vim /etc/default/bootlogd 

ed attivare l’opzione BOOTLOGD_ENABLE impostandola su Yes. Ora tutti i messaggi di boot, compresi quelli diretti a stderr 1), verranno salvati in /var/log/boot.

1) Linux ha a disposizione tre “canali” di Input/Opuput: uno di entrata denominato stdin, uno di uscita stdout (generalmente la console) ed infine uno per gli errori stderr. Qualsiasi programma ha le sue specifiche per i canali di Input/Ouput, ma qualsiasi canale può essere ridirezionato. Un programma può prendere stdin dall’input dell’utente o direttamente da un file, mandare stdout alla console/video/stampante e stderr in un altro file.
 
linux/debian/tips.txt · Ultima modifica: 02/07/2006 15:13
 

Contenuto disponibile sotto GNU Free Documentation License

Recent changes RSS feed GNU Free Documentation License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki