Spis treści

Sprawy dot. systemu Linux

Znakomite porady

W kupie i na temat: Easy Linux tips project

Co instalować (koniecznie)

Co jakiś czas trzeba instalować po raz kolejny Linuxa na kolejnym komputerze. Kiedy powstanie mechanizm skryptowy, który pozwoli raz a dobrze zanotować wszystkie te programiczki, które chcemy i powinniśmy mieć na naszej jednostce, żeby z satysfakcją i spokojem jej używać?

Narzędzia systemowe txt

Narzędzia, które działają w terminalu i bardzo usprawniają pracę.

LaTeX

PDF, PS

HTML

Backup listy zainstalowanych aplikacji i przeniesienie ich na nowy system

Create a backup of what packages are currently installed:

dpkg --get-selections > list.txt

Then (on another system) restore installations from that list:

dpkg --clear-selections
sudo dpkg --set-selections < list.txt

To get rid of stale packages

sudo apt-get autoremove

To get installed like at backup time (i.e. to install packages set by dpkg –set-selections)

sudo apt-get dselect-upgrade

Albo lista wrzuconych komend instalacji

To list all packages intentionally installed by apt commands, run the following :

( zcat $( ls -tr /var/log/apt/history.log*.gz ) ;\\
cat /var/log/apt/history.log ) | egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep '^Commandline:'

This provides a reverse time based view, with older commands listed first:

Commandline: apt-get install k3b
Commandline: apt-get install jhead

Installation data also showing synaptic usage, but without details (the same with installation date) :

( zcat $( ls -tr /var/log/apt/history.log*.gz ) ; \\
cat /var/log/apt/history.log ) | egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep -B1 '^Commandline:'

providing the following:

Start-Date: 2012-09-23  14:02:14
Commandline: apt-get install gparted
Start-Date: 2012-09-23  15:02:51
Commandline: apt-get install sysstat
Or (with zgrep and removing update messages):
 
zgrep -hE '^(Start-Date:|Commandline:)' $(ls -tr /var/log/apt/history.log*.gz ) | egrep -v 'aptdaemon|upgrade' | egrep -B1 '^Commandline:'

Sprawdzanie dysku z konsoli

Lepsze niż sprawdzanie w pętli…

du -hx --max-depth=1 /

Czyszczenie dysku z konsoli

Najpierw:

sudo apt-get autoclean
sudo apt-get autoremove

Rozważ, czy na tym komputerze potrzebujesz te wszystkie zainstalowane programy:

dpkg --get-selections | grep -v deinstall

Jeżeli chcesz zobaczyć, czy przypadkiem nie masz tam jakiegoś puszystego pakietu, wypytaj po nazwie, jak np.:

dpkg --get-selections | grep -v deinstall | grep office

Potem:

Porada znaleziona na Askubuntu

Since the case involves a system with 100% HD usage, so, installing any application will not work. The only safe option is to delete unnecessary files first.

First in row would be temporary files

sudo rm -rf /tmp/*

Second, delete the cached applications. These are the binaries of applications and upgrades downloaded through the lifespan of the system. Normally this would be no less than 500 MB in an average Ubuntu system with one year of operation, and would give you a breather to install another apps.

sudo rm /var/cache/apt/archives/*deb

Then I would recommend deleting old log files

sudo rm /var/log/*gz

By this you would have at least free space of around 700 MB. This will allow you to work with utilities and install new ones.

Then I would install ncdu, which is a fast utility to scan the whole harddisk, and order directories by size. It is really fast, and works like a charm.

sudo apt-get install ncdu

then run it with the command

sudo ncdu /

The slash after ncdu is to scan from the root directory.

All the above works in ubuntu server as well as Desktop. Now, after doing all the above, and you are running on a Desktop environment, then , you can go for GUI utilities such as ubuntu-tweak (which is excellent by the way) and delete the old kernels. I usually keep the latest kernel, and the one before the latest, in case of upgrade failures.

Hope that this would help.

UUID dysków

blkid

Autostart z terminala

Niech program ten będzie się nazywał filename:

sudo su
cd /etc/init.d/
ln /path/to/filename filename
#############################
# jeśli trzeba to:
chmod +x /path/to/filename
#############################
sudo update-rc.d filename defaults 

Ale to nie zawsze działa. Lepiej zrobić skrypt, jak np. qbittorrent-nox-daemon: qbittorrent-nox-daemon.text

Serwer Calibre

Od dawna chciałem odpalić server Calibre, żeby mieć dostęp do książek z różnych stron, ale też żeby w razie czego móc udostępnić moje zbiory innym. Okazuje się, że w połączeniu z poradą piętro wyżej oraz plikiem konfiguracyjnym stąd powinno dać się to zrobić.

Pamiętajmy, że ewentualne ręczne opcje serwera Calibre można ustawić dzięki tej pomocy.

Dropbox autostart on boot

RADA STĄD