Tips and Tricks: Difference between revisions
No edit summary |
No edit summary |
||
| Line 87: | Line 87: | ||
</source> | </source> | ||
== KDE Fixes == | |||
=== .gtkrc isn't honoured by GTK Applications anymore === | |||
KDE overrides the GTK colours with global ones, if you want that. If not (since it also overrides the GTK theme with the ugly default one) you can disable that behaviour under System Settings -> Appearance -> Colors at the bottom. This does not always work, so copy over your .gtkrc-2.0 from your homedir or one of the themes that come with the theme pack. | |||
{{Codeline|# cp ~/.gtkrc-2.0 ~/.kde/share/config/gtkrc-2.0}} | |||
{{Codeline|# cp /usr/share/themes/Clearlooks/gtk-2.0/gtkrc ~/.gtkrc-2.0}} | |||
For more information have a look at [[GTK_Anwendungen_unter_KDE|GTK Applications under KDE]]. | |||
[[Kategorie:Software]] | [[Kategorie:Software]] | ||
Revision as of 22:19, 4 January 2008
Paketverwaltung
Zu welchem Paket gehört Datei X
# equery belongs -f <dateiname>
Welche Pakete haben USE-Flag X
# equery hasuse <useflag>
Backup von installiertem Paket anlegen
# quickpkg net-www/apache
Danach kann man das Paket auf einem anderen Rechner installieren oder schnell downgraden, wenn bei einem Update etwas schief gelaufen ist. Die Datei befindet sich dann in Template:Filename bzw. ein Symlink auf die Datei in Template:Filename. Zur Installation:
# emerge --usepkgonly "<net-www/apache-2.2.4"
Überflüssige Pakete erkennen und entfernen
# emerge depclean --pretend
Profil wechseln / auf neue Version updaten
# emerge eselect
# eselect profile list
# eselect profile set <nummer>
SCP Dateitransfer
Datenaustausch zwischen zwei Rechnern über Kommandozeile.
Datei hochladen:
# scp /root/htdocsbackup.tar.bz2 root@entfernter-server.de:/root/
Datei runterladen:
# scp root@entfernter-server.de:/root/htdocsbackup.tar.bz2 /root/htdocsbackup.tar.bz2
SSH Tunnel
Ist auf dem Server nur der SSH Port offen aber man möchte sich z.B. auf den auf Port 8080 laufenden Tomcat Webserver verbinden so kann man das über einen SSH Tunnel machen.
# ssh -N -i /home/benutzer/.ssh/id_dsa -L 7777:webserver:8080 root@webserver
Anschließend kann man den Tomcat unter localhost:7777 erreichen.
Yakuake DCOP-Skripte
MultiSSH
Per SSH auf mehrere Hosts verbinden, dafür jeweils ein neues Yakuake Tab anlegen und entsprechend benennen. multissh.sh
#!/bin/bash
[[ -n "$1" && -n "$2" ]] || {
echo "Usage: ./multissh.sh \"user\" \"server1 server2\""
echo " z.B.: ./multissh.sh \"root\" \"server1 server2\""; exit 0 ; }
lastid=`dcop yakuake DCOPInterface sessionIdList | awk -F, '{print $NF}'`
for i in $2 ; do
dcop yakuake DCOPInterface slotAddSession
let "lastid += 1"
dcop yakuake DCOPInterface slotRenameSession $lastid $i
dcop yakuake DCOPInterface slotRunCommandInSession $lastid "ssh $1@$i"
done
exit 0
MultiCommand
Ein Kommando in mehreren Yakuake Tabs ausführen. multicommand.sh
#!/bin/bash
[[ -n "$1" && -n "$2" ]] || {
echo "Usage: ./multicommand.sh \"tabname1 tabname2\" \"kommando\""
echo " z.B.: ./multicommand.sh \"server1 server2\" \"emerge --sync\""; exit 0 ; }
ids=`dcop yakuake DCOPInterface sessionIdList | sed 's/,/ /g'`
for i in $ids ; do
sessionname=`dcop yakuake DCOPInterface slotSessionName $i`
for x in $* ; do
if [ "$sessionname" = "$x" ] ; then
dcop yakuake DCOPInterface slotRunCommandInSession $i "$2"
fi
done
done
exit 0
KDE Fixes
.gtkrc isn't honoured by GTK Applications anymore
KDE overrides the GTK colours with global ones, if you want that. If not (since it also overrides the GTK theme with the ugly default one) you can disable that behaviour under System Settings -> Appearance -> Colors at the bottom. This does not always work, so copy over your .gtkrc-2.0 from your homedir or one of the themes that come with the theme pack.
# cp ~/.gtkrc-2.0 ~/.kde/share/config/gtkrc-2.0
# cp /usr/share/themes/Clearlooks/gtk-2.0/gtkrc ~/.gtkrc-2.0
For more information have a look at GTK Applications under KDE.