Skip to content

Instantly share code, notes, and snippets.

Avatar
🌤️
The sun is behind every cloud

Fedir RYKHTIK fedir

🌤️
The sun is behind every cloud
View GitHub Profile
@fedir
fedir / GopherCon_EU_Online_2020.md
Last active Nov 18, 2020
GopherCon Europe: Online 2020 videos - Ordered by "positive interest" metric with yrank
View GopherCon_EU_Online_2020.md
TITLE URL PUBLISHED AT POSITIVE INTERESTINGNESS TOTAL INTERESTINGNESS VIEWS LIKES DISLIKES COMMENTS TOTAL REACTION GLOBAL BUZZ INDEX
GopherCon Europe 2020: Kofo Okosela - Writing Open Source Tooling Using AST https://www.youtube.com/watch?v=0DE_7Nff6yg 2020-07-11 13:14:27 0.0323 0.0361 527 18 1 0 19 10013
GopherCon Europe 2020 LT: Ron Evans - A Small Update On TinyGo https://www.youtube.co
@fedir
fedir / Dockerfile
Last active Jul 8, 2020
Simple API server for SupInfo devops specialization
View Dockerfile
FROM golang:latest
RUN mkdir /app
ADD . /app/
WORKDIR /app
RUN go build -o main .
CMD ["/app/main"]
@fedir
fedir / .bashrc
Last active Mar 10, 2020
Kubernetes Linux Mint
View .bashrc
source <(kubectl completion bash) # active l'auto-complétion pour bash dans le shell courant, le paquet bash-completion devant être installé au préalable
echo "source <(kubectl completion bash)" >> ~/.bashrc # ajoute l'auto-complétion de manière permanente à votre shell bash
alias k=kubectl
complete -F __start_kubectl k
@fedir
fedir / tellmeyoursecrets.js
Last active Jan 20, 2020 — forked from rzrbld/tellmeyoursecrets.js
Google Apps Script that lists a lot of info about the files in a particular folder/sub folder structure including viewers, editors, and sharing access type
View tellmeyoursecrets.js
function listFolders(folder) {
var sheet = SpreadsheetApp.getActiveSheet();
sheet.appendRow(["Folder Name" ,"Name","Sharing Access", "Get Editors", "Get Viewers", "Date", "URL"]);
folderID = "ID"
listFolder(sheet, folderID)
}
function listFolder(sheet, folderID) {
var folder = DriveApp.getFolderById(folderID);
addRootFilesToSheet(sheet, folder)
@fedir
fedir / ResolvingGitConflictsInProduction.md
Created Jan 7, 2020
Resolving Git conflicts in production
View ResolvingGitConflictsInProduction.md

Checking for possible conflicts

git fetch origin branch
git diff --name-only HEAD..origin/branch
git diff HEAD..origin/branch directory_foo/file_bar.ext

Using git vimdiff

git config merge.tool vimdiff
git config merge.conflictstyle diff3
@fedir
fedir / goUpgrade.sh
Last active Dec 23, 2019
Go update script for Linux Mint / Ubuntu / Debian (and some other distributions)
View goUpgrade.sh
#!/bin/bash
# Golang upgrade script
# (C) 2019, Fedir RYKHTIK
# Usage: define the version constants and use it under the account
# Define target constants
VERSION="1.13.5"
OS="linux"
@fedir
fedir / logAnonymizeIps.sh
Last active Dec 18, 2019
SHELL > Replace any IP by G.D.P.R :)
View logAnonymizeIps.sh
#!/bin/bash
sed -i -e 's/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/G.D.P.R/g' some.log
@fedir
fedir / showMailQueue.sh
Created Dec 16, 2019
Show Postfix's mail queue content
View showMailQueue.sh
for emails in `mailq | awk '/^[0-9A-F][0-9A-F]/{print $1}'`; do postcat -q $emails;done
@fedir
fedir / pdf_compress.sh
Last active Oct 8, 2019
PDF compression with gs (works well on Linux Mint)
View pdf_compress.sh
# Compressing to EBook quality (between "screen" and "preprocess")
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
# Black and white output, with custom resolution
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dCompressFonts=true -r150 -dNOPAUSE -dQUIET -dBATCH -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray -sOutputFile=output.pdf input.pdf
@fedir
fedir / result_check.md
Last active Jul 22, 2020
Install WKHTMLTOPDF / WKHTMLTOX on CentOS
View result_check.md

Installation verification

Bad

$ wkhtmltopdf https://www.google.fr output.pdf
Loading pages (1/5)
Error: Failed loading page https://www.google.fr (sometimes it will work just to ignore this error with --ignore-load-errors)

Good

You can’t perform that action at this time.