Skip to content

Instantly share code, notes, and snippets.

@cbismuth
cbismuth / github_gpg_key.md
Last active May 19, 2022 01:35 — forked from ankurk91/github_gpg_key.md
Github : Signing commits using GPG (Ubuntu/Mac)
View github_gpg_key.md

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS
@cbismuth
cbismuth / exif-others.sh
Last active December 30, 2020 21:50
ExifTool command line to cleanup picture folders
View exif-others.sh
#!/usr/bin/env bash
set -e
set -u
export INPUT_DIR="${HOME}/Pictures/#sync/incoming"
export OUTPUT_DIR="${HOME}/Pictures/#sync/timestamps"
export REMOTE_DIR="${HOME}/Pictures/#sync/remote"
fdupes --recurse --noempty --nohidden --delete --noprompt ${INPUT_DIR}
@cbismuth
cbismuth / setup.sh
Last active December 23, 2019 17:23
Linux setup
View setup.sh
#!/usr/bin/env bash
echo 'fs.inotify.max_user_watches = 524288' | tee --append /etc/sysctl.conf > /dev/null
sysctl -p --system
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
apt-get -y update
apt-get -y upgrade
View dendrogram.py
# Perform the necessary imports
import matplotlib.pyplot as plt
from scipy.cluster.hierarchy import linkage, dendrogram
# Calculate the linkage: mergings
mergings = linkage(samples, method='single')
# Plot the dendrogram
dendrogram(mergings,
labels=country_names,
View pipeline.py
# Import pipeline
from sklearn.pipeline import Pipeline
# Import classifiers
from sklearn.linear_model import LogisticRegression
from sklearn.multiclass import OneVsRestClassifier
# Import CountVectorizer
from sklearn.feature_extraction.text import CountVectorizer
@cbismuth
cbismuth / elasticsearch-issue-34142.log
Last active November 28, 2018 17:51
cURL recreation script output to reproduce Elaticsearch issue #34142
View elasticsearch-issue-34142.log
[11-28-18 18:51:17] Delete [attachment] pipeline
{"acknowledged":true}
[11-28-18 18:51:17] Create [attachment] pipeline
{"acknowledged":true}
[11-28-18 18:51:17] Delete [index1] index
{"acknowledged":true}
[11-28-18 18:51:17] Create [index1] index
@cbismuth
cbismuth / elasticsearch-issue-34142.sh
Last active November 28, 2018 17:50
cURL recreation script to reproduce Elaticsearch issue #34142
View elasticsearch-issue-34142.sh
#!/usr/bin/env bash
# elasticsearch-issue-34142.sh
# cURL recreation script to reproduce Elaticsearch issue #34142
# https://github.com/elastic/elasticsearch/issues/34142
NL1="\n"
NL2="${NL1}${NL1}"
NC='\033[0m'
RED='\033[0;31m'
@cbismuth
cbismuth / elasticsearch-issue-34522.sh
Last active October 29, 2018 14:32
cURL recreation script to reproduce Elaticsearch issue #34522
View elasticsearch-issue-34522.sh
#!/usr/bin/env bash
# elasticsearch-issue-34522.sh
# cURL recreation script to reproduce Elaticsearch issue #34522
# https://github.com/elastic/elasticsearch/issues/34522
NL1="\n"
NL2="${NL1}${NL1}"
NC='\033[0m'
RED='\033[0;31m'
@cbismuth
cbismuth / exif-timestamps.sh
Last active October 22, 2018 13:36
ExifTool command line to sort pictures by timestamp
View exif-timestamps.sh
#!/usr/bin/env bash
set -e
set -u
fdupes --recurse --noempty --nohidden --delete --noprompt "#input"
exiftool -progress -r -d "#sync/timestamps/%Y/%m/%Y%m%d%H%M%S%%-c.%%ue" "-filename<filemodifydate" "-filename<createdate" "-filename<datetimeoriginal" "#input"
rsync -avzh --progress --stats --exclude '._*' --exclude '.DS_Store' "#sync/timestamps/" "/Volumes/NAS/cloud/Pictures/timestamps/"
@cbismuth
cbismuth / elasticsearch-issue-27178.sh
Last active October 15, 2018 07:33
cURL recreation script to reproduce Elaticsearch issue #27178
View elasticsearch-issue-27178.sh
#!/usr/bin/env bash
# elasticsearch-issue-27178.sh
# cURL recreation script to reproduce Elaticsearch issue #27178
# https://github.com/elastic/elasticsearch/issues/27178
NL1="\n"
NL2="${NL1}${NL1}"
NC='\033[0m'
RED='\033[0;31m'