CREATE DATABASE database;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
country=FR | |
cd /tmp | |
wget "https://www.archlinux.org/mirrorlist/?country=${country}&protocol=http&protocol=https&ip_version=4&ip_version=6" -O mirrorlist.tmp | |
sed -i 's/^#Server/Server/' mirrorlist.tmp | |
rankmirrors mirrorlist.tmp > mirrorlist | |
sudo cp mirrorlist /etc/pacman.d/mirrorlist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -o pipefail | |
ERRORS=() | |
# find all executables and run `shellcheck` | |
for f in $(find . -type f -not -iwholename '*.git*' | sort -u); do | |
if file "$f" | grep --quiet shell; then | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
directory = 'directory/' | |
new_base_filename_length = 10 | |
Dir.glob(directory + '*').sort.each do |old_filename| | |
new_base_filename = ('a'..'z').to_a.shuffle[0, new_base_filename_length].join | |
new_filename = directory + new_base_filename + File.extname(old_filename) | |
File.rename(old_filename, new_filename) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
plog = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location: | |
source_directories: | |
- /backup/lyra/files/rsync | |
one_file_system: true | |
repositories: | |
- /backup/lyra/files/borg | |
storage: | |
compression: zstd | |
umask: 0077 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const readline = require('readline'); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
}); | |
const ask = () => { | |
rl.question('> ', res => { | |
console.log(res); | |
ask(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Défi n°1 | |
villes = ['Paris', 'New York', 'Berlin', 'Montréal'] | |
puts "DEFI N°1 - Si j'étais en vacances, j'irais à..." | |
villes.each do |ville| | |
puts ville | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM elixir:1.6.4-alpine | |
ENV UID=911 GID=911 | |
RUN apk -U upgrade \ | |
&& apk add \ | |
build-base \ | |
wget \ | |
git \ | |
&& rm -rf /tmp/* /var/cache/apk/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker-compose pull | |
docker-compose up -d | |
docker system prune -af |