It's always usefull to visually see a git tree in the terminal
This quick snippet makes the git tree much easier to visualize in the terminal :
git config --global alias.tree 'log --graph --full-history --all --color --date=short --pretty=format:"%Cred%x09%h %Creset%ad%Cblue%d %Creset %s %C(bold)(%an)%Creset"'
Useful cheat sheet for kubernetes users like me
(on linux debian)
# install dependencies
sudo apt-get install sshfs
sudo adduser <username> fuse
Now mount the remote folder :
mkdir ~/remoteserv
sshfs -o idmap=user <username>@<ipaddress>:/remotepath ~/remoteserv
User vim locally on the mounted folder.
One line to set Nemo as your default file navigation software in Ubuntu.
xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search
Test it with : xdg-open $HOME
One line to set demo as your default file navigation software in Ubuntu.
xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search
Test it with : xdg-open $HOME
Write compile and test solidity contract with this online editor (meant for Ethereum).
A Keep It Simple Stupid "ncurse disk usage" utility.
So very efficient
Awesome utilility ....
sudo apt install tig
In your git project folder. A must have tool.
As it says : an initializer that will include all dependencies and setup a java spring project
damn tired seaching it because I keep forgetting.
Syntax is exactly the same as sed
:%s/search/replace/g
replace in the whole file
So easy and usefull :
watch kubectl get pods
by default watch
will launch the command and update the screen every 2 seconds.
Superb list.
Useful
The more I write docs / papers the more I use markdown the more I feel the need for a good markdown editor.
Typora is quite popular and has most of the functionalities I need.
A great Windows utility for connections (ssh, sftp, xterm...)
A must have in your windows toolbox.
New software for quick screenshots
Excellent
Great tool
So damn useful for testing and mounting environment very quickly.
Try it if you're familiar with docker / docker-compose / docker swarm.
Simple enough https deployment :
https config to deploy a shaarli ?
docker-compose up -d
me this :
version: '3'
services:
portainer:
image: portainer/portainer
container_name: portainer
command: -H unix:///var/run/docker.sock
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./portainer/data:/data
ports:
- "9000:9000"
environment:
- VIRTUAL_HOST=administration.yourdomain.com
- VIRTUAL_PORT=9000
- LETSENCRYPT_HOST=administration.yourdomain.com
- LETSENCRYPT_EMAIL=myself@yourdomain.com
# proxy
proxy:
image: jwilder/nginx-proxy
container_name: proxy
ports:
- "80:80"
- "443:443"
restart: always
volumes:
- ./proxy/etc/nginx/certs:/etc/nginx/certs:rw
- ./proxy/etc/nginx/vhost.d:/etc/nginx/vhost.d
- ./proxy/usr/share/nginx/html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
labels:
- com.github.jrce pour le registre b.letsencrypt_nginx_proxy_companion.docker_gen
# lets encrypt for ssl
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./proxy/etc/nginx/certs:/etc/nginx/certs:rw
- ./proxy/etc/nginx/vhost.d:/etc/nginx/vhost.d
- ./proxy/usr/share/nginx/html:/usr/share/nginx/html
environment:
- DEFAULT_EMAIL=myself@yourdomain.com
- NGINX_PROXY_CONTAINER=proxy
###############################################################################
#
# S H A A R L I
#
# https://shaarli.yourdomain.com
#
###############################################################################
shaarli:
container_name: shaarli
image: shaarli/shaarli:master
volumes:
- ./shaarli/cache:/var/www/shaarli/cache
- ./shaarli/data:/var/www/shaarli/data
- ./shaarli/images:/var/www/shaarli/images
environment:
- VIRTUAL_HOST=links.yourdomain.com
- VIRTUAL_PORT=80
- LETSENCRYPT_HOST=links.yourdomain.com
- LETSENCRYPT_EMAIL=myself@yourdomain.com.com
NGINX as a front end reverse proxy for docker containers
How to fix the "perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "fr_FR.UTF-8"
are supported and installed on your system." issue, often encountered when deploying
I want to destroy all my images AND all my containers (bye bye EVERYTHING, be warned). This is DEFINITIVE.
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
Reading ongoing console logs can be a pain when you don't know a couple tricks.
It keeps going on...
Quick how to :
- do put your terminal to infinite scoll (preferences)
- Use CTRL + S to halt so you can scroll and read peacefully
- Use CTR + Q to resume
- you can always pipe your ongoing logs to |less -G, then you will be able to use search patterns.