Tips and Tricks: Difference between revisions

From Q
Jump to navigation Jump to search
Tgurr (talk | contribs)
No edit summary
Tgurr (talk | contribs)
mNo edit summary
Line 2: Line 2:


=== To which package belongs file X ===
=== To which package belongs file X ===
{{Codeline|# equery belongs -f <dateiname>}}
{{Root|equery belongs -f <dateiname>}}


=== Which packages has USE-Flag X ===
=== Which packages has USE-Flag X ===
{{Codeline|# equery hasuse <useflag>}}
{{Root|equery hasuse <useflag>}}


=== Backup an installed package ===
=== Backup an installed package ===
{{Codeline|# quickpkg net-www/apache}}
{{Root|quickpkg net-www/apache}}


After this you can install the package on another machine or do a fast downgrade if something went bad after an update. You can find the file under {{Filename|/usr/portage/packages/All}} and in this example a symlink to the apache file in {{Filename|/usr/portage/packages/net-www}}. To install the now precompiled binary use:
After this you can install the package on another machine or do a fast downgrade if something went bad after an update. You can find the file under {{Filename|/usr/portage/packages/All}} and in this example a symlink to the apache file in {{Filename|/usr/portage/packages/net-www}}. To install the now precompiled binary use:


{{Codeline|# emerge --usepkgonly "<net-www/apache-2.2.4"}}
{{Root|emerge --usepkgonly "<net-www/apache-2.2.4"}}


=== Detect and get rid of leftover packages ===
=== Detect and get rid of leftover packages ===
{{Codeline|# emerge depclean --pretend}}
{{Root|emerge depclean --pretend}}


=== Change your current profile ===
=== Change your current profile ===
{{Codeline|# emerge eselect}}
{{Root|emerge eselect}}


{{Codeline|# eselect profile list}}
{{Root|eselect profile list}}


{{Codeline|# eselect profile set <nummer>}}
{{Root|eselect profile set <nummer>}}


== Useful commands ==
== Useful commands ==
Recursively set directory permissions to 755:
Recursively set directory permissions to 755:


{{Codeline|<nowiki># find /var/www/path -type d -print0 | xargs -0 chmod -c 755</nowiki>}}
{{Root|<nowiki>find /var/www/path -type d -print0 | xargs -0 chmod -c 755</nowiki>}}


== Character conversion ==
== Character conversion ==
Line 33: Line 33:
Recursively rename directory and files from ISO-8859-15 to UTF-8:
Recursively rename directory and files from ISO-8859-15 to UTF-8:


{{Codeline|<nowiki># convmv -f iso-8859-15 -t utf8 -r /var/www/path --preserve-mtimes --notest</nowiki>}}
{{Root|<nowiki>convmv -f iso-8859-15 -t utf8 -r /var/www/path --preserve-mtimes --notest</nowiki>}}


== SCP file transfer ==
== SCP file transfer ==
Line 40: Line 40:
Upload file:
Upload file:


{{Codeline|# scp /root/htdocsbackup.tar.bz2 root@remote-host.de:/root/}}<br />
{{Root|scp /root/htdocsbackup.tar.bz2 root@remote-host.de:/root/}}<br />
Download file:
Download file:


{{Codeline|# scp root@remote-host.de:/root/htdocsbackup.tar.bz2 /root/htdocsbackup.tar.bz2}}
{{Root|scp root@remote-host.de:/root/htdocsbackup.tar.bz2 /root/htdocsbackup.tar.bz2}}


Upload directory:
Upload directory:


{{Codeline|# scp -p -r /root/directory root@remote-host.de:/root}}<br />
{{Root|scp -p -r /root/directory root@remote-host.de:/root}}<br />
Download directory:
Download directory:


{{Codeline|# scp -p -r root@remote-host.de:/root/directory /root}}
{{Root|scp -p -r root@remote-host.de:/root/directory /root}}


== SSH tunnel ==
== SSH tunnel ==
Very useful if the server you want to connect to has only the SSH port open and/or a firewall infront and you want to access for example a tomcat server running on port 8080.
Very useful if the server you want to connect to has only the SSH port open and/or a firewall infront and you want to access for example a tomcat server running on port 8080.


{{Codeline|# ssh -N -i /home/<user>/.ssh/id_dsa -L 7777:remote-host.de:8080 root@remote-host.de}}
{{Root|ssh -N -i /home/<user>/.ssh/id_dsa -L 7777:remote-host.de:8080 root@remote-host.de}}


After establishing the tunnel you can access the tomcat server of the remote machine port 8080 at your localhost port 7777.
After establishing the tunnel you can access the tomcat server of the remote machine port 8080 at your localhost port 7777.


== KDE4 problems and workarounds ==
== KDE4 problems and workarounds ==
=== ~/.gtkrc-2.0 doesn't affect GTK applications anymore ===
KDE overrides the gtkrc with it's own, if you want that. You can disable that behaviour under System Settings -> Appearance -> Colors at the bottom. However this currently does not work, so copy over your .gtkrc-2.0 from your homedir or one from the themes that come with the gtk-engines package.
{{Codeline|# cp ~/.gtkrc-2.0 ~/.kde/share/config/gtkrc-2.0}}
{{Codeline|# cp /usr/share/themes/Clearlooks/gtk-2.0/gtkrc ~/.kde/share/config/gtkrc-2.0}}
For more information have a look at [[GTK_Anwendungen_unter_KDE|GTK Applications under KDE]].


=== Reset to the default Plasma layout ===
=== Reset to the default Plasma layout ===
Log out of KDE/X and delete from tty:
Log out of KDE/X and delete from tty:


{{Codeline|# rm ~/.kde/share/config/plasma*}}
{{Code|rm ~/.kde/share/config/plasma*}}


=== Change the Dolphin standard view to detailed view for ALL folders ===
=== Change the Dolphin standard view to detailed view for ALL folders ===

Revision as of 17:05, 13 January 2011

Package management

To which package belongs file X

# equery belongs -f <dateiname>

Which packages has USE-Flag X

# equery hasuse <useflag>

Backup an installed package

# quickpkg net-www/apache

After this you can install the package on another machine or do a fast downgrade if something went bad after an update. You can find the file under Template:Filename and in this example a symlink to the apache file in Template:Filename. To install the now precompiled binary use:

# emerge --usepkgonly "<net-www/apache-2.2.4"

Detect and get rid of leftover packages

# emerge depclean --pretend

Change your current profile

# emerge eselect
# eselect profile list
# eselect profile set <nummer>

Useful commands

Recursively set directory permissions to 755:

# find /var/www/path -type d -print0 | xargs -0 chmod -c 755

Character conversion

Recursively rename directory and files from ISO-8859-15 to UTF-8:

# convmv -f iso-8859-15 -t utf8 -r /var/www/path --preserve-mtimes --notest

SCP file transfer

File transfer via commandline.

Upload file:

# scp /root/htdocsbackup.tar.bz2 root@remote-host.de:/root/


Download file:

# scp root@remote-host.de:/root/htdocsbackup.tar.bz2 /root/htdocsbackup.tar.bz2

Upload directory:

# scp -p -r /root/directory root@remote-host.de:/root


Download directory:

# scp -p -r root@remote-host.de:/root/directory /root

SSH tunnel

Very useful if the server you want to connect to has only the SSH port open and/or a firewall infront and you want to access for example a tomcat server running on port 8080.

# ssh -N -i /home/<user>/.ssh/id_dsa -L 7777:remote-host.de:8080 root@remote-host.de

After establishing the tunnel you can access the tomcat server of the remote machine port 8080 at your localhost port 7777.

KDE4 problems and workarounds

Reset to the default Plasma layout

Log out of KDE/X and delete from tty:

Code: rm ~/.kde/share/config/plasma*

{{{2}}}

Change the Dolphin standard view to detailed view for ALL folders

Open Dolphin -> Settings > Configure Dolphin -> Views -> Common Tab -> and mark -> Use the same view for all folders