Linux
====== Applications ======
stoptpper tomact7
modifier la config des users puyis faire un chown sur le fichier
depolyer l'archive
start tomcat
{{page>knowdb:linux:tutos:homepage}}
=== Installer fail2ban ===
aptitude install fail2ban
====Commandes Rapides====
=== Curl ===
sudo curl https://yt-dl.org/downloads/2016.04.24/youtube-dl -o /usr/local/bin/youtube-dl -x http://172.16.20.1:8080
===Update Host Key===
How to establish ssh key pair when Host...
ssh-keygen -R hostname
This deletes the offending key from the known_hosts
The man page entry reads:
-R hostname Removes all keys belonging to hostname from a known_hosts file. This option is useful to delete hashed hosts (see the -H option above).
=== Alias ===
~/.bashrc
=== Clear Console ===
clear or cls
=== Text Editors ===
A simple editor to learn is ee(1), which stands for easy editor. To start this editor, type ee filename where filename is the name of the file to be edited. Once inside the editor, all of the commands for manipulating the editor's functions are listed at the top of the display. The caret (^) represents Ctrl, so ^e expands to Ctrl+e. To leave ee(1), press Esc, then choose the “leave editor” option from the main menu. The editor will prompt to save any changes if the file has been modified.
FreeBSD also comes with more powerful text editors, such as vi(1), as part of the base system. Other editors, like editors/emacs and editors/vim, are part of the FreeBSD Ports Collection. These editors offer more functionality at the expense of being more complicated to learn. Learning a more powerful editor such as vim or Emacs can save more time in the long run.
====== DHCP Client Configuration ======
<code>
sudo dhclient --help
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Usage: dhclient [-4|-6] [-SNTP1dvrx] [-nw] [-p <port>] [-D LL|LLT]
[-s server-addr] [-cf config-file] [-lf lease-file]
[-pf pid-file] [--no-pid] [-e VAR=val]
[-sf script-file] [interface]
sudo dhclient wlan0
</code>
Voici quelques commandes pour compresser et décompresser vos fichiers et dossier sur Linux :
====== SubSonic ======
* [[knowdb:dev:sql:hsqldb]]
SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.SYSTEM_COLUMNS
Accès à la base de données : /db.view
==== Variables d'Environnement ====
To see your currently defined variables, open up your terminal and type the command
env
===== Logs =====
|App|Log|
|Apache|/var/log/apache2/|
|Subsonic|/var/subsonic/subsonic.log|
|Mod JK|/var/log/apache2/mod_jk.log|
===== Créer un lien symbolique =====
A symlink is a symbolic link, this is, an alias or shortcut to a program or file.
It's a special file existing in the FileSystem space which just points to another file (or directory). If you access the symlink from an application, it appears transparent for the application and you will really access the file or directory which the symlink is pointing to.
It is a special kind of file that contains a pathname to another file. The file type entry in the file's inode indicates that it is a symbolic link. When you attempt to access a symbolic link with a text editor or other program, the kernel redirects the program to the file indicated by the symbolic link's pathname. Unlike hard links, symbolic links can be made across different filesystems. Use the ln command with the -s option to create a symbolic link.
The symlinks utility performs maintenance on symbolic links. Symlinks checks for symlink problems, including dangling symlinks which point to nonexistent files. Symlinks can also automatically convert absolute symlinks to relative symlinks. Install the symlinks package if you need a program for maintaining symlinks on your system.
Note: If you delete the symlink, you are only deleting the symlink! Not the file or directory it was pointing to!
Although a symlink shows up with file permissions and user/group ownerships, the access rights are only determined by its target permissions and user/group ownerships!
You create a symlink with
ln -s <destination file or directory> <name of the symlink>
===== Trouver la Taille des repertoires =====
du -s -h /var/log/
===== Uptime Record =====
18:46:23 up 422 days, 21:44, 1 user, load average: 0.20, 0.28, 0.23
{{tag>Linux Debian Shell Commandes Tar Zip Ls Ln}}
stoptpper tomact7
modifier la config des users puyis faire un chown sur le fichier
depolyer l'archive
start tomcat
{{page>knowdb:linux:tutos:homepage}}
=== Installer fail2ban ===
aptitude install fail2ban
====Commandes Rapides====
=== Curl ===
sudo curl https://yt-dl.org/downloads/2016.04.24/youtube-dl -o /usr/local/bin/youtube-dl -x http://172.16.20.1:8080
===Update Host Key===
How to establish ssh key pair when Host...
ssh-keygen -R hostname
This deletes the offending key from the known_hosts
The man page entry reads:
-R hostname Removes all keys belonging to hostname from a known_hosts file. This option is useful to delete hashed hosts (see the -H option above).
=== Alias ===
~/.bashrc
=== Clear Console ===
clear or cls
=== Text Editors ===
A simple editor to learn is ee(1), which stands for easy editor. To start this editor, type ee filename where filename is the name of the file to be edited. Once inside the editor, all of the commands for manipulating the editor's functions are listed at the top of the display. The caret (^) represents Ctrl, so ^e expands to Ctrl+e. To leave ee(1), press Esc, then choose the “leave editor” option from the main menu. The editor will prompt to save any changes if the file has been modified.
FreeBSD also comes with more powerful text editors, such as vi(1), as part of the base system. Other editors, like editors/emacs and editors/vim, are part of the FreeBSD Ports Collection. These editors offer more functionality at the expense of being more complicated to learn. Learning a more powerful editor such as vim or Emacs can save more time in the long run.
====== DHCP Client Configuration ======
<code>
sudo dhclient --help
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Usage: dhclient [-4|-6] [-SNTP1dvrx] [-nw] [-p <port>] [-D LL|LLT]
[-s server-addr] [-cf config-file] [-lf lease-file]
[-pf pid-file] [--no-pid] [-e VAR=val]
[-sf script-file] [interface]
sudo dhclient wlan0
</code>
Voici quelques commandes pour compresser et décompresser vos fichiers et dossier sur Linux :
====== SubSonic ======
* [[knowdb:dev:sql:hsqldb]]
SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.SYSTEM_COLUMNS
Accès à la base de données : /db.view
==== Variables d'Environnement ====
To see your currently defined variables, open up your terminal and type the command
env
===== Logs =====
|App|Log|
|Apache|/var/log/apache2/|
|Subsonic|/var/subsonic/subsonic.log|
|Mod JK|/var/log/apache2/mod_jk.log|
===== Créer un lien symbolique =====
A symlink is a symbolic link, this is, an alias or shortcut to a program or file.
It's a special file existing in the FileSystem space which just points to another file (or directory). If you access the symlink from an application, it appears transparent for the application and you will really access the file or directory which the symlink is pointing to.
It is a special kind of file that contains a pathname to another file. The file type entry in the file's inode indicates that it is a symbolic link. When you attempt to access a symbolic link with a text editor or other program, the kernel redirects the program to the file indicated by the symbolic link's pathname. Unlike hard links, symbolic links can be made across different filesystems. Use the ln command with the -s option to create a symbolic link.
The symlinks utility performs maintenance on symbolic links. Symlinks checks for symlink problems, including dangling symlinks which point to nonexistent files. Symlinks can also automatically convert absolute symlinks to relative symlinks. Install the symlinks package if you need a program for maintaining symlinks on your system.
Note: If you delete the symlink, you are only deleting the symlink! Not the file or directory it was pointing to!
Although a symlink shows up with file permissions and user/group ownerships, the access rights are only determined by its target permissions and user/group ownerships!
You create a symlink with
ln -s <destination file or directory> <name of the symlink>
===== Trouver la Taille des repertoires =====
du -s -h /var/log/
===== Uptime Record =====
18:46:23 up 422 days, 21:44, 1 user, load average: 0.20, 0.28, 0.23
{{tag>Linux Debian Shell Commandes Tar Zip Ls Ln}}
====== Compression sous Linux ======
===== RAR / UNRAR =====
Compresser un repertoire, conserver l'arborescence
rar a -r directory.rar directory/*
Compresser une liste de repertoires
<code>
for folder in */
do
echo rar a -r "${folder%/}.rar" "$folder"
done
</code>
===== TAR =====
tar -cvzf data20130707.tar /home/corp/data
* tar -cf arch.tar rep : Créer une archive tar du répertoire « rep »
* tar -tf arch.tar : Examine le contenu de l'archive arch.tar
* tar -xf arch.tar Extrait de l'archive arch.tar
* cd /home; tar -xf archive.tar : Décompresse un fichier ou dossier dans /home (cas général)
* tar -xpf archive.tar Décompresse un fichier ou dossier en conservant le plus possible les droits (drapeaux set-UID notamment)
===== TAR.BZ2 =====
Decompresser
tar -jxvf filename.tar.bz2
===== UNTAR =====
Décompresse un fichier ou dossier dans /home (pour les versions récentes de tar)
tar -xf arch.tar -C /home :
* tar -xjf fichier.tar.bz2 : Décompresse un fichier ou un dossier au format .tar.bz2 sur GNU
* tar -xzf fichier.tgz : Décompresse un fichier ou dossier au format .tgz ou au format .gz (les versions récentes de tar)
===== ZIP =====
Compresser un repertoire, conserver l'arborescence
zip -R directory.zip directory/*
Compresse un fichier ou dossier au format .zip
zip arch.zip fichiers
* gzip fichier : Compresse un fichier ou dossier au format .gz
===== UNZIP =====
* unzip fichier.zip : Décompresser un fichier ou dossier au format .zip
* gunzip fichier.gz : Décompresser un fichier ou dossier au format .gz et le format.tgz
* uncompress fichier.Z : Décompresse un fichier ou dossier au format .Z
* compress fichier : Compresse un fichier ou un dossier au format .Z
* gunzip fichier.tgz | tar -xf- : Décompresse un fichier ou un dossier un dossier au format tgz ou gz (toutes les versions)
* bunzip fichier.bz2 | tar -xf - : Décompresse un fichier ou un dossier au format .tar.bz2 (cas général)
Commentaires
Enregistrer un commentaire