Skip to content

Instantly share code, notes, and snippets.

View jangeador's full-sized avatar
🐵

Delio Castillo jangeador

🐵
View GitHub Profile
@muendelezaji
muendelezaji / bash-to-zsh-hist.py
Created October 5, 2016 14:18 — forked from op/bash-history-to-zsh-history.py
Convert Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history
import sys
import time
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@erichelgeson
erichelgeson / sentry-docker.sh
Last active January 27, 2020 15:10
Sentry Docker
SENTRY_SECRET_KEY=longsecrethere
DOCKERPREFIX=eric
cat <<-EOF > requirements.txt
sentry-slack==0.5.0
EOF
cat <<-EOF > Dockerfile
FROM sentry:8.5-onbuild
EOF
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@ebuildy
ebuildy / docker-compose-sentry.yml
Created November 24, 2015 08:12
A simple docker-compose YML to run Sentry.
redis:
image: redis
postgres:
image: postgres:9.4
environment:
- POSTGRES_USER:sentry
- POSTGRES_PASSWORD:sentry
volumes:
- /var/data/sentry/postgre:/var/lib/postgresql/data:rw
@jangeador
jangeador / regex.txt
Created November 10, 2015 22:04
Sublime Text Filter for lines not containing
# Filter for all lines not containing the string ',KG,'
^((?!,KG,).)*$
@outime
outime / model_to_dict_verbose.py
Last active October 7, 2015 15:12
Modification to model_to_dict() Django function to return a dict of verbose field names instead
from itertools import chain
from django.db.models.fields.related import ManyToManyField
def model_to_dict_verbose(instance, fields=None, exclude=None):
"""
Returns a dict containing the data in ``instance`` suitable for passing as
a Form's ``initial`` keyword argument. Keys in dict are exchanged for
verbose names contained in the model.
``fields`` is an optional list of field names. If provided, only the named
fields will be included in the returned dict.
@EfrainReyes
EfrainReyes / FizzBuzz.cs
Created November 28, 2014 13:42
Fizz Buzz using functional C#
Enumerable.Range(1, 30).Select(num =>
((Func<string[], string>)
(buzz => new string[]{
buzz[((num + 2) % 3) / 2] +
buzz[((num + 4) % 5) / 4 * 2],
""+num
}.First(r => r != "")))(new[] { null, "fizz", "buzz"})
).ToList().ForEach(s => Console.WriteLine(s));
@wdullaer
wdullaer / install.sh
Last active April 3, 2025 19:08
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@glass5er
glass5er / pptximage.py
Last active August 13, 2024 13:24
add an image in every Powerpoint slide using python-pptx
##
## Copy & Paste Tool for images to PowerPoint(.pptx)
##
import pptx
import pptx.util
import glob
import scipy.misc
OUTPUT_TAG = "MY_TAG"