Skip to content

Instantly share code, notes, and snippets.

# add this to ~/.gitconfig:
[core]
excludesfile = ~/.gitignore
# create ~/.gitignore
.idea
@gponty
gponty / gist:81be0e7974ca45cd3bb62c5c2f772ddb
Last active February 21, 2020 13:12
Vue ui à travers Docker
vue ui --headless --port 8888 --host 0.0.0.0
@gponty
gponty / gist:cdbe93187d58bba9a58c30077176bcdc
Created December 12, 2019 12:13
Taille disque et repertoire Linux
Taille des disques :
df -h
Taille des repertoire:
du /usr -h --max-depth=0
Fichier de plus de xMo :
find / -type f -size +500000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"yourOrganization"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"YourUser"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"YourPassword"} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-"github.com"} # the GitHub hostname (see comments)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted
@gponty
gponty / gist:bf50374877c4f5e83a3fa86f123440cb
Created November 28, 2019 13:09
Linux recherche dans un fichier
find . -type f -exec grep textearechercher {} \; -printf "%p - %u\n"
@gponty
gponty / mysql-docker.sh
Created June 2, 2019 12:28 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@gponty
gponty / gist:cb755ebb486edab6f7eeaa359be6225b
Last active February 21, 2019 08:44
Bash docker exec
dbash() { docker exec -u 1000 -it $(docker ps -aqf "name=$1") bash; }
dbashsudo() { docker exec -it $(docker ps -aqf "name=$1") bash; }
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile