Skip to content

Instantly share code, notes, and snippets.

View Sounds-of-Science's full-sized avatar

Fred Valentin Sounds-of-Science

View GitHub Profile
@Sounds-of-Science
Sounds-of-Science / Package Control.sublime-settings
Last active December 25, 2015 05:09
My user "Package Control.sublime-settings".
{
"installed_packages":
[
"Alignment",
"ApacheConf.tmLanguage",
"BracketHighlighter",
"Dayle Rees Color Schemes",
"HTML5",
"jQuery",
"jQuery Snippets pack",
@Sounds-of-Science
Sounds-of-Science / SQL-ServerCommands.sql
Last active December 31, 2015 19:59
Useful SQL commands
-- Display all the database names on the instance
EXEC sp_databases
-- Display database size
USE database_Name;
GO EXEC sp_spaceused N'table_Name';
GO
-- Put the db in read-only mode
USE master EXEC sp_dboption 'Nom_Database', 'read only', 'TRUE'
@Sounds-of-Science
Sounds-of-Science / mysql-dump.sql
Last active January 1, 2016 10:29
MySQL Dump - INNODB
-- The .sql file will contain drop table, create table and insert command for all the tables in the specified database.
-- if necessary, install mysqldump
sudo apt-get install mysqldump
-- backup:
mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
-- restore:
@Sounds-of-Science
Sounds-of-Science / windows-shell.bat
Last active January 1, 2016 10:49
Windows commands... general list of interesting commands
:: Commande DOS pour récupérer les différents moniteurs de performance sur une machine Windows :
typeperf -qx>>perfcounter.txt
:: Commande pour afficher les serveurs qui hébergent LDAP dans le domaine
:: Peut être exécuté sans le "domaine name" et retourne tout les domaines disponibles
nslookup
> set types=all
> _ldap._tcp.<your domain name>
@Sounds-of-Science
Sounds-of-Science / findExternalIPaddress.sh
Created December 30, 2013 13:11
Tip to find ip address on a cloud server.
dig +short @resolver1.opendns.com myip.opendns.com
@Sounds-of-Science
Sounds-of-Science / Linux-WebServer
Created January 14, 2014 08:43
Display tcp connections on the machine and their states.
# Display tcp connections on the machine and their states.
netstat -an | awk '/tcp/ {print $6}' | sort | uniq -c
@Sounds-of-Science
Sounds-of-Science / verifyHash_opensslSHA256.sh
Created January 18, 2014 18:29
Verify SHA256 (signed hash file) with openssl on Linux/os X
openssl dgst -sha256 /path/to/file
# To remember this simple trick, RSYNC cmd
#
# -a option will use recursive mode, preserve any symbolic links, preserves file and directory permissions,
# preserves the timestamp, and preserve the owner and group.
# -v for verbose mode or info=progress2 for rsync 3.0+
rsync -av --exclude ".DS_Store" --progress /Volumes/Source/ /Volumes/TargetBackup/
afinfo /path_to/filename.format | grep "bit rate"
# commande : xattr
# affiche les attributs étendus du fichier
xattr /path_to/filename
# supprimer un attribut
xattr -d com.apple.quarantine /path_to/filename
# supprimer tous les attributs du fichier
xattr -c /path_to/filename