programming:bash:miscellaneous_notes
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
programming:bash:miscellaneous_notes [2012/05/08 14:08] – created sbolay | programming:bash:miscellaneous_notes [2012/05/09 19:24] (current) – [Installing/Upgrading Software] sbolay | ||
---|---|---|---|
Line 24: | Line 24: | ||
</ | </ | ||
- | <note warning>the precedent runlevel will be closed by the new one. That means if the actual runlevel is 5 and you want to go to the runlevel 3 all the user connexions will be closed! See man init for other run level</ | + | Warning: |
==== mount ==== | ==== mount ==== | ||
Line 702: | Line 702: | ||
In order to use X11 forwarding through ssh, you have to: on debian (server) | In order to use X11 forwarding through ssh, you have to: on debian (server) | ||
- | apt-get install xbase-client | + | * apt-get install xbase-client |
- | in / | + | |
- | Restart ssh daemon /etc/ssh restart | + | |
login to the server ssh -X -v -v -v root@xxx.xxx.xxx.xxx | login to the server ssh -X -v -v -v root@xxx.xxx.xxx.xxx | ||
The triple -v is to obtain debug up to level 3 and -X is to enable X11forwarding to the client side but seems not be absolutely necessary to make the X11 tunnel working. You can now try “xclock &” included in the xbase-client package to test the X11 connection. | The triple -v is to obtain debug up to level 3 and -X is to enable X11forwarding to the client side but seems not be absolutely necessary to make the X11 tunnel working. You can now try “xclock &” included in the xbase-client package to test the X11 connection. | ||
Line 710: | Line 711: | ||
If you get an error such as | If you get an error such as | ||
+ | <code bash> | ||
root@siro2: | root@siro2: | ||
_X11TransSocketINETConnect() can't get address for localhost: | _X11TransSocketINETConnect() can't get address for localhost: | ||
Error: Can't open display: localhost: | Error: Can't open display: localhost: | ||
- | The main reasons of that can be (from linuxquestions.org): | + | </ |
+ | |||
+ | The main reasons of that can be (from [[http:// | ||
+ | |||
+ | * You should NEVER EVER login as root. | ||
+ | * You should REALLY REALLY use sudo(1) or su(1) when you need to run one command whith root privilege | ||
- | You should NEVER EVER login as root. | ||
- | You should REALLY REALLY use sudo(1) or su(1) when you need to run one command whith root priv:s | ||
Might be that ssh is doing the right thing and don't let you use X11 over ssh as root. | Might be that ssh is doing the right thing and don't let you use X11 over ssh as root. | ||
Line 722: | Line 727: | ||
If you are login as a normal user and you have the same error, you may need to issue an | If you are login as a normal user and you have the same error, you may need to issue an | ||
+ | <code bash> | ||
export DISPLAY=" | export DISPLAY=" | ||
+ | </ | ||
+ | |||
before it works. You can also add this command in the user's .bashrc file. | before it works. You can also add this command in the user's .bashrc file. | ||
- | If you put instead export DISPLAY=“127.0.0.1: | + | If you put instead |
You can see wich are your actual Xauthority setting with: | You can see wich are your actual Xauthority setting with: | ||
+ | <code bash> | ||
xauth info | xauth info | ||
xauth list | xauth list | ||
+ | </ | ||
and if you need to add a new Xauthority to the .Xauthority file, you can issue: | and if you need to add a new Xauthority to the .Xauthority file, you can issue: | ||
+ | <code bash> | ||
xauth add `echo " | xauth add `echo " | ||
+ | </ | ||
Below is displayed the settings of the / | Below is displayed the settings of the / | ||
+ | <code bash> | ||
Host * | Host * | ||
# | # | ||
Line 765: | Line 774: | ||
GSSAPIAuthentication yes | GSSAPIAuthentication yes | ||
GSSAPIDelegateCredentials no | GSSAPIDelegateCredentials no | ||
- | And last, below is displayed the /etc/ | + | </code> |
+ | And last, below is displayed the / | ||
+ | <code bash> | ||
# What ports, IPs and protocols we listen for | # What ports, IPs and protocols we listen for | ||
Port 22 | Port 22 | ||
Line 841: | Line 852: | ||
UsePAM yes | UsePAM yes | ||
- | MySQL | + | </ |
+ | ===== MySQL ===== | ||
/ | / | ||
- | Set the MySQL root password | + | ==== Set the MySQL root password |
- | PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: | ||
+ | PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: | ||
+ | <code bash> | ||
/ | / | ||
#or | #or | ||
/ | / | ||
- | Test the MySQL daemon | + | </ |
+ | ==== Test the MySQL daemon ==== | ||
You can test the MySQL daemon with the benchmarks in the ' | You can test the MySQL daemon with the benchmarks in the ' | ||
+ | <code bash> | ||
cd / | cd / | ||
perl run-all-tests | perl run-all-tests | ||
+ | </ | ||
+ | |||
Default options are read from the following files in the given order: /etc/my.cnf / | Default options are read from the following files in the given order: /etc/my.cnf / | ||
- | Create a DB | + | ==== Create a DB ==== |
In the below example, “intranet” is the name of your database. | In the below example, “intranet” is the name of your database. | ||
+ | <code bash> | ||
mysqladmin -u root -p create intranet | mysqladmin -u root -p create intranet | ||
- | Create a table | + | </ |
+ | ==== Create a table ==== | ||
Create the tables using an example.sql file: | Create the tables using an example.sql file: | ||
+ | <code bash> | ||
mysql -u root -p intranet < example.sql | mysql -u root -p intranet < example.sql | ||
- | See the content of the database | + | </ |
+ | ==== See the content of the database ==== | ||
See the content of the intranet db | See the content of the intranet db | ||
+ | <code bash> | ||
mysqlshow -u root -p intranet | mysqlshow -u root -p intranet | ||
- | Add Privileges to a database | + | </ |
+ | ==== Add Privileges to a database ==== | ||
+ | <code bash> | ||
mysql -u root -p intranet | mysql -u root -p intranet | ||
Enter password: | Enter password: | ||
Line 885: | Line 905: | ||
mysql> GRANT ALL PRIVILEGES ON *.* TO " | mysql> GRANT ALL PRIVILEGES ON *.* TO " | ||
- | CUPS | + | </ |
+ | ===== CUPS ===== | ||
/etc/cups | /etc/cups | ||
- | cupsd.conf | + | ==== cupsd.conf |
- | + | ||
- | (2 modifications) 1) | + | |
+ | (2 modifications) | ||
+ | - <code bash> | ||
# DocumentRoot: | # DocumentRoot: | ||
# By default "/ | # By default "/ | ||
# | # | ||
DocumentRoot / | DocumentRoot / | ||
- | 2) | + | </ |
+ | - <code bash> | ||
< | < | ||
# You definitely will want to limit access to the administration functions. | # You definitely will want to limit access to the administration functions. | ||
Line 918: | Line 939: | ||
#Encryption Required | #Encryption Required | ||
</ | </ | ||
- | printers.conf | + | </ |
+ | ==== printers.conf ==== | ||
(below an example) | (below an example) | ||
+ | <code bash> | ||
<Printer HP_Laserjet_6MP> | <Printer HP_Laserjet_6MP> | ||
Info B& | Info B& | ||
Line 933: | Line 955: | ||
KLimit 0 | KLimit 0 | ||
</ | </ | ||
- | SOME ADVICES log: / | + | </ |
+ | |||
+ | **SOME ADVICES** log: / | ||
- | Creating root access (by default cups will have no user and pw) lppasswd -g sys -a root #this command will allow you to login as root for administration task in cups | + | **Creating root access (by default cups will have no user and pw)** lppasswd -g sys -a root #this command will allow you to login as root for administration task in cups |
- | restart the server siro:/ | + | **restart the server** siro:/ |
For probleme with the lp command, see below: when I want to print with lp or lpr I always get the following errormsg: lp: error - scheduler not responding! or lpr: error - scheduler not responding! By the way, cups prints its testpage correctly, only lp® doesn' | For probleme with the lp command, see below: when I want to print with lp or lpr I always get the following errormsg: lp: error - scheduler not responding! or lpr: error - scheduler not responding! By the way, cups prints its testpage correctly, only lp® doesn' | ||
Line 943: | Line 967: | ||
These “lp” and “lpr” commands or for CUPS, they work only with running CUPS daemon (the scheduler) or with a remote CUPS server specified in / | These “lp” and “lpr” commands or for CUPS, they work only with running CUPS daemon (the scheduler) or with a remote CUPS server specified in / | ||
- | FTP | + | ===== FTP ===== |
vsftpd: (man vsftpd) The vsftpd FTP server serves FTP connections. It uses normal, unencrypted usernames and passwords for authentication. vsftpd is designed to be secure. | vsftpd: (man vsftpd) The vsftpd FTP server serves FTP connections. It uses normal, unencrypted usernames and passwords for authentication. vsftpd is designed to be secure. | ||
daemon configuration file: / | daemon configuration file: / | ||
- | / | + | ==== / |
+ | <code bash> | ||
service ftp | service ftp | ||
{ | { | ||
Line 964: | Line 987: | ||
| | ||
} | } | ||
+ | </ | ||
+ | |||
At this time I don't understand every options in this service (TODO) | At this time I don't understand every options in this service (TODO) | ||
- | / | + | ==== / |
+ | <code bash> | ||
# Local FTP user Settings | # Local FTP user Settings | ||
# | # | ||
Line 983: | Line 1008: | ||
# Note: if this setting is disabled, windows stations will not be able to login. | # Note: if this setting is disabled, windows stations will not be able to login. | ||
pasv_enable=YES | pasv_enable=YES | ||
- | changing local_umask=077 to 022 allows users (for example the xerox scanner) to put in the directory (for example | + | </code> |
- | The vsftpd daemon has to be restarted with / | + | |
- | NFS | + | |
- | Example | + | * changing local_umask=077 |
+ | * The vsftpd daemon has to be restarted with / | ||
- | Server: | + | ===== NFS ===== |
+ | |||
+ | Example to connect NeXT computers (This example is with SuSe): | ||
+ | |||
+ | ==== Server ==== | ||
In YaST → Network Services → NFS Server : Start NFS Server (go next) Set Directories to: / | In YaST → Network Services → NFS Server : Start NFS Server (go next) Set Directories to: / | ||
Line 995: | Line 1023: | ||
chmod 777 /server chmod 777 / | chmod 777 /server chmod 777 / | ||
- | Client: | + | ==== Client |
Open a terminal on a NeXT computer: NextApps → Terminal.app | Open a terminal on a NeXT computer: NextApps → Terminal.app | ||
- | + | - cd /etc (where all services are located as the function ” mount” …) | |
- | cd /etc (where all services are located as the function ” mount” …) | + | |
- | vi /etc/hosts and add eg. “192.168.1.22 siro” | + | |
- | as root: cd /etc | + | |
mount -t nfs siro:/ | mount -t nfs siro:/ | ||
Line 1013: | Line 1039: | ||
(this setting should allow the user to login to the NFS server | (this setting should allow the user to login to the NFS server | ||
if special settings are made on the shared directory) | if special settings are made on the shared directory) | ||
- | SAMBA | ||
- | Connection error | + | ===== SAMBA ===== |
+ | ==== Connection error ==== | ||
If a user can not login normally on the XP computer: | If a user can not login normally on the XP computer: | ||
- | printers can not be add correctly (error 5 given by Kixtart - rights error) | + | - printers can not be add correctly (error 5 given by Kixtart - rights error) |
- | Users can simply not loggin on the computer (windows says pw error!) | + | |
I dont know exactly the reason of that but it seems that is caused by a sid error or something like this. To get right of this problem we have to clean the user profile. | I dont know exactly the reason of that but it seems that is caused by a sid error or something like this. To get right of this problem we have to clean the user profile. | ||
- | Loggoff the user witch as the problematic profile | + | - Loggoff the user witch as the problematic profile |
- | mv / | + | |
- | mkdir / | + | |
- | chmod and chown | + | |
- | To resolve this you can either: | + | |
- | Logon on a machine where the user does not yet has a saved profile with is username and pw to recreate a “clean” profile or | + | |
- | Logon to the machine usually used by the user as local/ | + | |
- | Suppress the local copy of profiles: My Computer -> properties -> Advanced -> UserProfiles… | + | |
- | settings: remove all profiles except local\administrator | + | |
- | regedit the registry and suppress everything about the user (make some searches with specific keywords) | + | |
- | Restart the computer | + | |
- | loggin | + | - login as network\administrator (to install and reset the registry with clean values - see kixtart script) |
- | loggoff | + | - logoff |
- | loggin | + | - login as the user to recreate a “clean” profile |
- | loggoff | + | - logoff |
- | On the server copy all relevant/ | + | |
- | chmod / chown on this folders | + | |
- | Done… and the user can loggin back on computers and everything should be ok. | + | |
- | WARNING: Do not mv but cp data from the backuped folder to the new one and keep it for days to be able to give user back some possible forgotten data! | + | |
- | mapping a windows group to a UNIX/LINUX group | + | <note warning> |
+ | |||
+ | ==== mapping a windows group to a UNIX/LINUX group ==== | ||
net groupmap add ntgroup=“Users” UNIXgroup=users net groupmap list | net groupmap add ntgroup=“Users” UNIXgroup=users net groupmap list | ||
pour recuperer vos anciens profils, il faut les migrer de l' | pour recuperer vos anciens profils, il faut les migrer de l' | ||
+ | * les mettre sur le serveur en mode itinerant (c'est mieux avec samba au depart pour la migration | ||
+ | * partager le dossier comme necessaire (voir la doc de samba sur les profils) | ||
+ | * une fois tous les profils sur le serveur disons dans le dossier /users dans chaque dossier utilisateur / | ||
- | les mettre sur le serveur en mode itinerant (c'est mieux avec samba au depart pour la migration | ||
- | partager le dossier comme necessaire (voir la doc de samba sur les profils) | ||
- | une fois tous les profils sur le serveur disons dans le dossier /users dans chaque dossier utilisateur / | ||
donc la marche a suivre est la suivante : | donc la marche a suivre est la suivante : | ||
+ | * vous creez les users dans samba: smbpasswd etc… | ||
+ | * vous recuperez le SID de l' | ||
+ | * pdbedit -Lv user1 et cherchez la ligne SID (sous l forme S-X-……) | ||
- | vous creez les users dans samba: smbpasswd etc… | ||
- | vous recuperez le SID de l' | ||
- | pdbedit -Lv user1 et cherchez la ligne SID (sous l forme S-X-……) | ||
ensuite c'est simple, profiles ntuser.dat va vous afficher plein de lignes cherchez le SID dedans et faite un remplacement comme ceci: | ensuite c'est simple, profiles ntuser.dat va vous afficher plein de lignes cherchez le SID dedans et faite un remplacement comme ceci: | ||
+ | * profiles ntuser.dat OLDSID NEWSID sur les PC | ||
+ | * ensuite dans document and settings supprimez TOUS les profils sur toutes les machines correspondants a ceux que vous avez envoyé sur le serveur. | ||
+ | * y a plus qu'a vous logguer et vous n' | ||
- | profiles ntuser.dat OLDSID NEWSID sur les PC | + | ===== inetd / xinetd |
- | ensuite dans document and settings supprimez TOUS les profils sur toutes les machines correspondants a ceux que vous avez envoyé sur le serveur. | + | |
- | y a plus qu'a vous logguer et vous n' | + | |
- | inetd / xinetd | + | |
all ports are listed in / | all ports are listed in / | ||
Line 1069: | Line 1097: | ||
starting the xinetd daemon: sudo / | starting the xinetd daemon: sudo / | ||
+ | <code bash> | ||
su | su | ||
ps -u root | grep xinetd (get PID of xinetd) | ps -u root | grep xinetd (get PID of xinetd) | ||
kill -s SIGUSR1 "PID of xinetd" | kill -s SIGUSR1 "PID of xinetd" | ||
+ | </ | ||
+ | |||
Now you can simply / | Now you can simply / | ||
- | nmap / xnmap | + | ===== nmap / xnmap ===== |
test open ports on an given host nmap / xnmap (==nmapfe) (from package nmap-gtk which is a nmap frontend) example: nmap localhost | test open ports on an given host nmap / xnmap (==nmapfe) (from package nmap-gtk which is a nmap frontend) example: nmap localhost | ||
Line 1081: | Line 1111: | ||
Starting nmap 3.50 ( http:// | Starting nmap 3.50 ( http:// | ||
- | PORT STATE SERVICE | + | ^PORT ^STATE |
- | 22/tcp open ssh | + | |22/ |
- | 25/tcp open smtp | + | |25/ |
- | 80/tcp open http | + | |80/ |
- | 111/tcp open rpcbind | + | |111/ |
- | 139/tcp open netbios-ssn | + | |139/ |
- | 445/tcp open microsoft-ds | + | |445/ |
- | 901/tcp open samba-swat | + | |901/ |
Nmap run completed – 1 IP address (1 host up) scanned in 0.356 seconds | Nmap run completed – 1 IP address (1 host up) scanned in 0.356 seconds | ||
to scan the complete network: 192.168.1.0/ | to scan the complete network: 192.168.1.0/ | ||
- | netstat | + | ==== netstat |
I' | I' | ||
- | nmblookup | + | ==== nmblookup |
return the ip adresse given a machineName | return the ip adresse given a machineName | ||
- | + | * nmblookup “machineName” | |
- | nmblookup “machineName” | + | |
an equivalent on windows is nbtstat (nbtstat -a “machineName”) | an equivalent on windows is nbtstat (nbtstat -a “machineName”) | ||
- | findsmb | + | ==== findsmb |
return all smb client/ | return all smb client/ | ||
- | nslookup / dig / host | + | ==== nslookup / dig / host ==== |
return the domaine name given the ip and vice-versa | return the domaine name given the ip and vice-versa | ||
- | ifconfig | + | === ifconfig |
returns the actual settings on localhost (to be used as SU) | returns the actual settings on localhost (to be used as SU) | ||
e-mail settings: / | e-mail settings: / | ||
- | Referer | + | == Referer |
+ | * http:// | ||
+ | * http:// | ||
- | http:// | + | == Other: == |
- | http:// | + | * before configuration, |
- | Other: | + | |
- | before configuration, | ||
or | or | ||
- | / | + | * / |
- | verify the network module is loaded by issuing / | + | |
- | activate the eth0 by issuing ifup eth0 | + | |
or | or | ||
- | / | + | * / |
/ | / | ||
+ | * name server 151.201.0.39 # same as the DNS servers IP in windows ipconfig | ||
- | name server 151.201.0.39 # same as the DNS servers IP in windows ipconfig | ||
/ | / | ||
+ | * order hosts, bind | ||
+ | * multi on | ||
- | order hosts, bind | ||
- | multi on | ||
/etc/hosts | /etc/hosts | ||
+ | * 127.0.0.1 localhost loopback | ||
+ | * 192.168.0.1 this.host.name | ||
- | 127.0.0.1 localhost loopback | ||
- | 192.168.0.1 this.host.name | ||
hostname: | hostname: | ||
+ | * / | ||
- | / | ||
change IP address permanently | change IP address permanently | ||
+ | * ifconfig eth0 %newip% | ||
+ | * vi / | ||
- | ifconfig eth0 %newip% | + | ===== Shell ===== |
- | vi / | + | === shells === |
- | Shell | + | * echo $SHELL |
+ | * chsh (change shell) | ||
- | shells | + | === Useful keys and how to set them to work === |
+ | * stty -a (to check the list of the current terminal settings) | ||
+ | * stty erase ^H | ||
+ | * stty kill ^U | ||
+ | * unset var_name | ||
- | echo $SHELL (what my shell is) | + | === csh === |
- | chsh (change shell) | + | * setenv var_name var_value |
- | Useful keys and how to set them to work | + | * unsetenv var_name |
- | stty -a (to check the list of the current terminal settings) | + | ==== Using EMACS ==== |
- | stty erase ^H | + | * exit: CTRL+XC |
- | stty kill ^U | + | * help: CTRL+H |
- | unset var_name | + | * open file: CTRL+XF (or new file) |
- | csh: | + | * save file: CTRL+XS |
+ | * save as: CTRL+XW | ||
- | setenv var_name var_value | + | === Repaint screen === |
- | unsetenv var_name | + | * CTRL+l (lowcased L) |
- | Using EMACS | + | |
- | exit: CTRL+XC | + | === Undo last edit(can be repeated) |
- | help: CTRL+H | + | |
- | open file: CTRL+XF (or new file) | + | |
- | save file: CTRL+XS | + | |
- | save as: CTRL+XW | + | |
- | Repaint screen | + | |
- | + | ||
- | CTRL+l (lowcased L) | + | |
- | Undo last edit(can be repeated) | + | |
- | + | ||
- | CTRL+/ | + | |
#Redo last | #Redo last | ||
- | to abort any control or escape sequence | + | === to abort any control or escape sequence |
+ | * CTRL+G | ||
- | CTRL+G | + | === move cursor to line beginning |
- | move cursor to line beginning | + | * CTRL+A |
- | CTRL+A | + | === move cursor to line end === |
- | move cursor to line end | + | * CTRL+E |
- | CTRL+E | + | === to mark block beginning |
- | to mark block beginning | + | * CTRL+@ |
- | CTRL+@ | + | === cutting the block === |
- | cutting the block | + | * CTRL+W |
- | CTRL+W | + | === pasting the block(can also paste the clipboard from other program) |
- | pasting the block(can also paste the clipboard from other program) | + | * CTRL+Y |
- | CTRL+Y | + | === copy the block === |
- | copy the block | + | * ESC+W |
- | ESC+W | + | === delete from cursor to line end === |
- | delete from cursor to line end | + | |
- | + | ||
- | CTRL+K | + | |
C-s search the document forward for string you name C-r search the document backward for string you name | C-s search the document forward for string you name C-r search the document backward for string you name | ||
- | CVS | + | ==== CVS ==== |
remote cvs if using ssh (bash/) To set an environment variable in sh or ksh, use the syntax VAR=value; | remote cvs if using ssh (bash/) To set an environment variable in sh or ksh, use the syntax VAR=value; | ||
+ | <code bash> | ||
[root@localhost root]# CVS_RSH=ssh | [root@localhost root]# CVS_RSH=ssh | ||
[root@localhost root]# export CVS_RSH | [root@localhost root]# export CVS_RSH | ||
[root@localhost root]# echo $CVS_RSH | [root@localhost root]# echo $CVS_RSH | ||
+ | </ | ||
+ | |||
using csh | using csh | ||
+ | <code bash> | ||
[root@localhost root]# setenv CVS_RSH ssh | [root@localhost root]# setenv CVS_RSH ssh | ||
- | cvs checkout | + | </ |
+ | === cvs checkout === | ||
cvs -d : | cvs -d : | ||
- | cvs KEY LETTERS | + | === cvs KEY LETTERS |
- | + | | |
- | P: the file has been updated. The P is shown if the file has been added to the repository in the meantime or if it has been changed, but you have not made any changes to this file yourself. | + | |
- | U: You have changed this file in the meantime, but nobody else has. | + | |
- | M: You have changed this file in the meantime, and somebody else has checked in a newer version. All the changes have been merged successfully. | + | |
- | C: You have changed this file in the meantime, and somebody else has checked in a newer version. During the merge attempt, conflicts have arisen. | + | |
- | ?: CVS has no information about this file - that is, this file is not under CVS's control. | + | |
- | Adding action in right clic | + | |
- | + | ||
- | kde | + | |
+ | ==== Adding action in right clic ==== | ||
+ | === kde === | ||
for one specific user add in | for one specific user add in | ||
+ | * ~/ | ||
- | ~/ | ||
or for all users add in | or for all users add in | ||
- | / | + | * / |
a file named openassu.desktop that contains: | a file named openassu.desktop that contains: | ||
+ | <code bash> | ||
[Desktop Entry] | [Desktop Entry] | ||
ServiceTypes=inode/ | ServiceTypes=inode/ | ||
Line 1251: | Line 1279: | ||
Icon=kfm | Icon=kfm | ||
Exec=kdesu " | Exec=kdesu " | ||
+ | </ | ||
+ | |||
or another file named runassu.desktop that contains: | or another file named runassu.desktop that contains: | ||
+ | <code bash> | ||
[Desktop Entry] | [Desktop Entry] | ||
ServiceTypes=application/ | ServiceTypes=application/ | ||
Line 1264: | Line 1295: | ||
Icon=kfm | Icon=kfm | ||
Exec=kdesu -c | Exec=kdesu -c | ||
- | gnome | + | </ |
+ | === gnome === | ||
Add in directory ~/ | Add in directory ~/ | ||
+ | <code bash> | ||
!/bin/sh | !/bin/sh | ||
openas-root: | openas-root: | ||
#nautilus script for opening the selected files as superuser (uid=0), | #nautilus script for opening the selected files as superuser (uid=0), | ||
#utilizing the appropriate applications. | #utilizing the appropriate applications. | ||
- | + | ||
for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; | for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; | ||
gnome-sudo " | gnome-sudo " | ||
done | done | ||
- | for more information see: http:// | + | </code> |
- | Installing/Upgrading Software | + | for more information see: http:// |
- | + | ||
- | upgrading software | + | |
+ | ==== Installing/ | ||
+ | === upgrading software === | ||
ldd / | ldd / | ||
- | using RPM | + | == using RPM == |
- | + | | |
- | rpm -i SuperFrob-4.i386.rpm (install a new package) | + | |
- | rpm -U SuperFrob-4.i386.rpm (update a package that is already installed) | + | |
- | rpm -e SuperFrob-5 (uninstall) | + | |
- | rpm -q SuperFrob (find the version number of an installed package) | + | |
- | rpm -qa (get a list of all installed package) | + | |
- | rpm -qf / | + | |
- | rpm -qi gcc (display information about the specified package) | + | |
- | rpm -qpl SuperFrob-5.i386.rpm (show the files that will be installed for the specified package file) | + | |
- | using DEB | + | |
- | deb file:/// | + | == using DEB == |
- | deb http:// | + | * deb file:/// |
- | deb-src http:// | + | |
- | deb http:// | + | |
- | deb-src http:// | + | |
- | deb http:// | + | |
- | Hardware | + | |
+ | ==== Hardware ==== | ||
to eject cd tray | to eject cd tray | ||
eject -r | eject -r | ||
- | Programming | + | ==== Programming |
debug core file | debug core file | ||
gdb < | gdb < | ||
- | ERRORS: | + | ==== ERRORS |
- | + | ||
- | GTK-WARNING XXX:Cannot open display | + | |
- | + | ||
- | Question | + | |
+ | === GTK-WARNING XXX:Cannot open display === | ||
+ | == Question == | ||
I'm compiling wxGTK on Redhat Linux 6.1: the following are my step when compiled wxGTK: | I'm compiling wxGTK on Redhat Linux 6.1: the following are my step when compiled wxGTK: | ||
- | ./ | + | * ./ |
- | make | + | |
- | make install | + | |
- | ldconfig | + | |
then edit / | then edit / | ||
- | make -f makefile.unx | + | * make -f makefile.unx |
when i run calendar application error happend: GTK-WARNING XXX:Cannot open display. What should i do ?. | when i run calendar application error happend: GTK-WARNING XXX:Cannot open display. What should i do ?. | ||
- | Answer | + | == Answer |
I see 3 cases : | I see 3 cases : | ||
- | You are not directly log on the computer where you run the programme (you do a rlogin or a telnet), in this case you have to set the DISPLAY variable to your computer display (export DISPLAY=mycomputeur.mydomain.org: | + | - You are not directly log on the computer where you run the programme (you do a rlogin or a telnet), in this case you have to set the DISPLAY variable to your computer display (export DISPLAY=mycomputeur.mydomain.org: |
- | You log as user1, and after that you do a su and try to run the program as root. In this case the Xserver is the property of user1 and you try to access it as root, so it refused the connection. solution: run the programme as user1 (good one), or log as root (bad one). | + | |
- | Last you dont have an xserver on the computer. | + | |
I think in your case the most probable is the 2) | I think in your case the most probable is the 2) |
programming/bash/miscellaneous_notes.1336486138.txt.gz · Last modified: 2012/05/08 14:08 by sbolay