Skip to content

Instantly share code, notes, and snippets.

View wvides's full-sized avatar
:octocat:
Immutable is the way

Walter Vides wvides

:octocat:
Immutable is the way
  • Berlin, Germany
View GitHub Profile
@wvides
wvides / scanner.sh
Created July 28, 2020 13:44 — forked from andyrbell/scanner.sh
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@wvides
wvides / config.yaml
Last active February 24, 2020 21:46
repos:
- id: /.*/
apply_requirements: [approved]
allowed_overrides: [apply_requirements, workflow]
allow_custom_workflows: true
workflow: custom
workflows:
custom:
plan:
steps:
@wvides
wvides / config.yaml
Last active February 24, 2020 22:08
# Atlantis server config file
repos:
- id: /.*/
apply_requirements: [approved]
allowed_overrides:
- apply_requirements
- workflow
allow_custom_workflows: true
@wvides
wvides / snake.py
Created November 18, 2019 12:52 — forked from sanchitgangwar/snake.py
Snakes Game using Python
# SNAKES GAME
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
from random import randint
curses.initscr()
win = curses.newwin(20, 60, 0, 0)
@wvides
wvides / shell-commands.sh
Last active October 27, 2019 10:09
Create a sentry instance
docker run -d --name sentry-redis redis
docker run -d --name sentry-postgres -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=sentry postgres
docker run --rm sentry config generate-secret-key # This will generate a key, use it for the next steps
docker run -it --rm -e SENTRY_SECRET_KEY='GENERATED_KEY' --link sentry-postgres:postgres --link sentry-redis:redis sentry upgrade
docker run -d --name sentry-cron -e SENTRY_SECRET_KEY='GENERATED_KEY' --link sentry-postgres:postgres --link sentry-redis:redis sentry run cron
@wvides
wvides / promise.js
Created October 20, 2019 18:47
Promise migration example
function somethingP(params) {
const error = false;
return promise = new Promise((resolve, reject) => {
if (error) {
reject(error);
}
else {
resolve('No error');
}
});
@wvides
wvides / promise.js
Created October 20, 2019 18:47
Promise migration example
function somethingP(params) {
const error = false;
return promise = new Promise((resolve, reject) => {
if (error) {
reject(error);
}
else {
resolve('No error');
}
});
@wvides
wvides / ssh-tunnel-proxy-digitalocean.md
Created June 10, 2019 06:10 — forked from nathanleclaire/ssh-tunnel-proxy-digitalocean.md
A description of how to get started using SSH tunneling. Intended for subverting network shaping and other nasty things imposed on you by arbitrary networks.

This is a method to create a proxy which is pretty simple and does not involve using shady websites or proprietary applications, etc.

  1. First, create a server, such as a DigitalOcean droplet.

  2. Once the server is created, verify that you can login via SSH:

    $ ssh user@<ip>
    
  3. If that is working, creating a local [SOCKS5] proxy using OpenSSH is just one command. Here is one suggestion:

while true; do
today=`date '+%Y_%m_%d'`
todaylong=`date '+%Y_%m_%d__%H_%M_%S'`
echo "${todaylong}" >> "${today}.log"
sleep 30m
done
@wvides
wvides / gist:2ac6bde23690beba9c2647e83b0553a1
Created August 22, 2018 21:57
Zookeeper installation fails
amazon-ebs: Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
amazon-ebs: Cleaning up list of fastest mirrors
amazon-ebs: Retrieving http://archive.cloudera.com/cdh5/one-click-install/redhat/6/x86_64/cloudera-cdh-5-0.x86_64.rpm
amazon-ebs: Preparing...
(100%)#
amazon-ebs: Loaded plugins: fastestmirror
amazon-ebs: Determining fastest mirrors
amazon-ebs: cloudera-cdh5 | 951 B 00:00
amazon-ebs: cloudera-cdh5/primary | 45 kB 00:00
amazon-ebs: cloudera-cdh5 153/153