Skip to content

Instantly share code, notes, and snippets.

View Daniel-M's full-sized avatar
💻
Coding

Daniel Mejía Raigosa Daniel-M

💻
Coding
View GitHub Profile
@Daniel-M
Daniel-M / main.py
Last active May 24, 2022 19:47
Filling scammers database with trash using selenium https://daniel-m.github.io/2022/05/dealing-with-scammers-using-selenium/
import time
import random
import string
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from seleniumwire import webdriver
def random_with_N_digits(n):

Run local EKS stack with docker

docker pull elasticsearch:7.16.3
docker pull kibana:7.16.3

docker network create eks
docker run --rm --name es-node01 --net eks -p 9200:9200 \
 -p 9300:9300 -e "discovery.type=single-node" \
@Daniel-M
Daniel-M / show_git_branch.sh
Created March 6, 2020 16:41
Show git branch on prompt
## Show git branch in prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[31m\]\$(parse_git_branch)\[\033[00m\]\$ "
@Daniel-M
Daniel-M / yaml.snippets
Created March 3, 2020 14:31
Kubernetes Autocompletion for UltiSnips
snippet pod "kubernetes Pod"
apiVersion: v1
kind: Pod
metadata:
name: ${1:PodName}
namespace: ${2:Namespace}
labels:
${3:LabelName}: ${4:LabelValue}
spec:
containers:
@Daniel-M
Daniel-M / neovim-plugins
Created October 21, 2019 20:28
Neovim Plugins
" *************************************
" PLUGIN SECTION for Vim-Plug
" *************************************
call plug#begin('~/.config/nvim/plugged')
" Make sure you use single quotes
""
""
@Daniel-M
Daniel-M / git_helper.sh
Last active April 11, 2019 17:14
git_helper bash function
git_helper() {
usage(){
echo "Usage: git_aid [command]"
echo ""
echo "Where [command] is any of,"
echo " * last commit. Shows last commit"
echo " * last branch. Shows last commit"
echo " * recent branches. Shows a list of recent branches and commits with committer"
echo " * recent commits. Shows a list of recent branches and commits with committer"
echo " * diff commits. Shows the difference between the two last commits"
@Daniel-M
Daniel-M / goGetSSH.sh
Created April 6, 2019 02:24
Configure git to always use ssh
git config --global url.git@github.com:.insteadOf https://github.com/
git config --global url.git@gitlab.com:.insteadOf https://gitlab.com/
git config --global url.git@bitbucket.org:.insteadOf https://bitbucket.org/
@Daniel-M
Daniel-M / InstallToggle.sh
Last active March 18, 2019 23:31
Build the toggle desktop for Linux Debian https://www.toggl.com/
# Install the pre-requisites for the application
apt install qtwebengine5-dev libqt5x11extras5-dev libqtexengine-dev qtbase5-dev qtbase5-private-dev libssl-dev libxss-dev
git clone git@github.com:toggl/toggldesktop.git
cd toggldesktop
mkdir build
cd build
git checkout v7.4.377
cmake -DTOGGL_PRODUCTION_BUILD=ON ..
make -j5
@Daniel-M
Daniel-M / redshift.conf
Created March 14, 2019 00:59
Put this in `~/.config/redshift.conf`
; Global settings
[redshift]
temp-day=6500K
temp-night=3600
transition=1
;location-provider=geoclue2
location-provider=manual
; Solar elevation thresholds.
; By default, Redshift will use the current elevation of the sun to determine
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/local/lib/libOAuth2.so
-- Installing: /usr/local/lib/libBugsnag.so
-- Installing: /usr/local/lib/libLua.so
-- Installing: /usr/local/lib/libjsoncpp.so
-- Installing: /usr/local/lib/libQxt.so
-- Installing: /usr/local/lib/cmake/Poco/PocoConfig.cmake
-- Installing: /usr/local/lib/cmake/Poco/PocoConfigVersion.cmake
-- Installing: /usr/local/include/Poco