NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

LINUX, GIT, HACKING ***
***********************************

* Distribuzione e Versione di Linux e verifica 64bit
cat /etc/*-release
uname -m
* Scansione della Rete
nmap HOST-IP -Pn -O
94.23.64.24
****** ZIPPARE
tar -czvf nome_archivio.tar.gz nome_cartella_da_archiviare
****** ESTRARRE unzip
tar -xzvf nome_archivio.tar.gz


******* Chiave SSH
Creare una chiave:
ssh-keygen -t rsa -C "[email protected]"
Leggere la chiave:
cat ~/.ssh/id_rsa.pub


** Copiare la chiave SSH su server Remoto
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

**** DIMENSIONE DI UNA CARTELLA
du -sh <nome-cartella>
du -h --max-depth=0 <nome-cartella>
du -hs */ | sort -hr | head

**** COPIARE STATICAMENTE UN SITO WEB
wget --mirror -p --convert-links -P ./LOCAL-DIR WEBSITE-URL

**** ABILITARE CONNESSIONI SSH CON PASSWORD

sudo nano /etc/ssh/sshd_config
#impostare PasswordAuthentication yes
service sshd restart

***** Aggiungere un Path nella variabile di ambiente $PATH

echo $PATH
export PATH=$PATH:~/.composer/vendor/bin
echo $PATH
export PATH=/opt/.linuxbrew/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/marcello/.rvm/bin

***** COPIA SSH DI RETE
scp -rp [[user@]from-host:]source-file [[user@]to-host:][destination-file]


**** CREARE UN LINK SUL DESKTOP
sudo gnome-desktop-item-edit ~/Scrivania/ --create-new

**** TRACCIARE FUNZIONAMENTO VPN
tail -f /var/log/syslog

**** SVUOTARE UN FILE
cat /dev/null > path_file

**** effettuare un replace dentro un file
sed -i -e 's/spazioprova.com/salus/www.salus.com/g' salus_1.sql

sed -i -e 's/vecchio-valore/nuovo-valore/g' filename
***** Aggiungere utente ad uno o più gruppi
usermod -aG <gruppo o gruppi serparati da virgola> <utente>
***** Editare gruppi
sudo nano /etc/group


******** Modificare IP CENTOS
1. Comando: nano /etc/sysconfig/network-scripts/ifcfg-e <TAB>
2. Modificare l'IP
3. Riavviare il servizio di rete: /etc/init.d/network restart

**** MONTARE CARTELLA DI RETE SAMBA
//123.123.123.3/Assistenza/VM /media/NAS_VM cifs default 0 0

sudo mount -t cifs //123.123.123.3/Assistenza/VM /media/NAS_VM -o username=admin,password=0l0macro,dir_mode=0777,file_mode=0777,iocharset=utf8


***** Vedere testo di una pagina WEB da shell
curl -vk https://demservice.sanita.finanze.it/DemRicettaErogatoServicesWeb/services


****** Risolvere connessioni SSH lente:
1. Lanciare connessione ssh con opzione "-vvv", esempio: ssh -vvv [email protected]
2. Vedere qual'è il metodo che "fa perder tempo"
3. Disattivare il metodo di connessione:
3.1 sudo nano /etc/ssh/ssh_config
3.2 Incaso la rete si fermi in "Igssapi-keyex" oppure "gssapi-with-mic" impostare: GSSAPIAuthentication no

****** Modifica di Iptables,
nano /etc/sysconfig/iptables
sostituire il contenuto cpm:
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

NAT delle porte:
iptables -t nat -A PREROUTING -p tcp --dport 8080 -j REDIRECT --to-port 80


******** LAnciare comando in background
nohup COMANDO_DA_LANCIARE &
Esempio:
nohup /root/baasbox-0.9.2/start &

**** GIT ***********************************
*******************************************

*** GIT Estrarre tutti i file tra due commit
#git diff --name-only e87a3171c9f48acbe20e158e32ea2e28953c2bef 0b8e66d5175ff4ec12284e04cf3548e1a41081aa | zip dest.zip -@
git archive --output=file.zip HEAD $(git diff --name-only SHA1 SHA2)


*** GIT Estrarre tutti i file di un singolo commit commit
git diff-tree --no-commit-id --name-only -r d6f560c8d9e23201f8288d8cd1b2131db6dd9e72 | zip dest.zip -@

***GIT effettuare un Mirror di un BARE repository
cd old-repository.git
git push --mirror https://github.com/exampleuser/new-repository.git

***Ignorare chmod/chown sui file per git
git config core.filemode false

***Mostra e zippa tutti i file IGNORATI
#Mostra i file IGNORATI
find -type f | git check-ignore --stdin
#Zippa i file IGNORATI
find -type f | git check-ignore --stdin | zip files.zip -@

**** SICUREZZA - HACKING **************
*******************************************

* nikto Tool Linux per sicurezza dei siti web
https://github.com/sullo/nikto
* SeaSponge, un tool per studiare le minacce informatiche
https://github.com/mozilla/seasponge
• SQLMAP: http://sqlmap.org


Firewall:
sudo ufw status
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow www
sudo ufw enable
sudo ufw status


finger: informazioni su un utente


prezzi affiliato
magazzino lenti

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.