Skip to content

Instantly share code, notes, and snippets.

View FabienSalles's full-sized avatar
💭
I may be slow to respond.

Fabien Salles FabienSalles

💭
I may be slow to respond.
View GitHub Profile
@FabienSalles
FabienSalles / .gitconfig
Last active March 4, 2024 23:11
Git configuration
[alias]
st = status -sb
co = checkout
amend = commit --amend -C HEAD
lg = log --pretty=format:\"%C(yellow)%h %C(blue)%ad%C(red)%d %C(reset)%s%C(green) [%cn]\" --decorate --date=short
undo = reset --soft HEAD^
lg1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
unchanged = update-index --assume-unchanged
[color]
ui = true
@FabienSalles
FabienSalles / fix-404-elasticsearch-head.md
Last active August 29, 2015 14:06
404 sur le plugin HEAD d'Elasticsearch

Problème de page 404 sur l'url "http://localhost:9200/_plugin/head/"

Vérifier et faire le lien symbolique si ce dernier n'existe pas. Exemple : sudo ln -s /usr/local/elasticsearch-0.18.7/plugins/head/ /usr/share/elasticsearch/plugins/

@FabienSalles
FabienSalles / gist:7da23c5bb71eb46f4e71
Created June 9, 2015 08:24
Install ElasticSearch 1.4 sur Debian 7
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb http://packages.elastic.co/elasticsearch/1.4/debian stable main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update && sudo apt-get install elasticsearch
sudo update-rc.d elasticsearch defaults 95 10
vi /etc/elasticsearch/elasticsearch.yml et changer http.port: 9202
@FabienSalles
FabienSalles / gist:362c749ec2335dfd091d
Created August 19, 2015 12:21
Reset mysql root password
sudo -i
/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables &
mysql -u root mysql
update user set password=PASSWORD("mdp") where User='root';
flush privileges;
exit;
killall mysqld
/etc/init.d/mysql start
mysqldump -u root -p database > dump.sql
scp -P 22 root@host:dump.sql ./
pv sqlfile.sql | mysql -uxxx -pxxxx dbname
@FabienSalles
FabienSalles / gist:04cfc528cdea66663e6d
Last active September 10, 2015 07:58
Autoriser l'accès à un serveur mysql distant
sed -i 's/bind-address.*/bind-address = 0.0.0.0/' /etc/mysql/my.cnf && sudo service mysql restart
UPDATE mysql.user SET Host='%' WHERE Host='localhost' AND User='username';
FLUSH PRIVILEGES;
@FabienSalles
FabienSalles / phmyadmin
Created October 13, 2015 11:21
Vhost PhpMyAdmin
Alias /phpmyadmin/ "/usr/share/phpmyadmin/"
<Directory /usr/share/phpmyadmin/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
@FabienSalles
FabienSalles / nodejs to node ubuntu
Created March 16, 2017 13:15
/usr/bin/env: ‘node’: No such file or directory
sudo ln -s "$(which nodejs)" /usr/local/bin/node
docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)
Using cURL
curl -XDELETE localhost:9200/index/type/documentID
e.g.
curl -XDELETE localhost:9200/shop/product/1
You will then receive a reply as to whether this was successful or not. You can delete an entire index or types with an index also, you can delete a type by leaving out the document ID like so -