Skip to content

Instantly share code, notes, and snippets.

View miguelfrde's full-sized avatar
🙃
¯\_(ツ)_/¯

Miguel miguelfrde

🙃
¯\_(ツ)_/¯
View GitHub Profile
@miguelfrde
miguelfrde / power-set.py
Last active August 29, 2015 13:56
Power set
def power_set(lst):
result = [[]]
for x in lst:
result += [subset + [x] for subset in result]
return result
def power_set_one_line(lst):
return reduce(lambda r, x: [s + x for s in r], lst, [[]])
@miguelfrde
miguelfrde / initheroku.sh
Created July 10, 2014 19:27
Heroku Toolbelt setup
# Requirements:
# OSX: brew install heroku-toolbelt
# Arch Linux: wget -qO- https://toolbelt.heroku.com/install.sh | sh
# pacman -S openssh
# # Add /usr/local/heroku/bin to PATH
ssh-keygen -t rsa
heroku login
heroku keys:add
@miguelfrde
miguelfrde / binary.b
Last active January 4, 2016 05:09
Brainfuck program to generate next binary number
- initial mark (FF)
read input 49 = 1 and 48 = 0 (q0)
>>,[>,<-------- -------- -------- -------- -------- -------- >]
- final mark (FF)
<[-<] change ones for zeros until a zero is found (q1)
+ change zero for one (q1 to q2)
< ignore all characters until FF is found (q2)
+ increase by one (ensures that the data pointer moves until FF is found)
[ if the byte at the data pointer is zero then FF was found
- it wasn't zero decrease it
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}

Keybase proof

I hereby claim:

  • I am miguelfrde on github.
  • I am miguelfrde (https://keybase.io/miguelfrde) on keybase.
  • I have a public key ASDTyQNjIN6EunJlqu73C7qGjxeHCPWLBNskeI1hOqip_Qo

To claim this, I am signing this object:

@miguelfrde
miguelfrde / kubernetes-aws.sh
Created March 1, 2016 06:07
Kubernetes AWS
sudo apt-get update
sudo apt-get install -y python-pip
sudo pip install awscli
aws configure # enter credentials for a user with full s3,ec2 access / admin access
export KUBERNETES_PROVIDER=aws
export KUBE_AWS_ZONE=us-west-2a
export KUBE_AWS_INSTANCE_PREFIX=k8s
export KUBE_MINION_IMAGE=ami-9abea4fb # Ubuntu server 14.04
@miguelfrde
miguelfrde / rpi-static-ip.txt
Last active March 29, 2020 15:58
Raspberry Pi static IP wlan
###########################
# /etc/network/interfaces #
###########################
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
iface eth0 inet dhcp
@miguelfrde
miguelfrde / self_signed_ssl.sh
Last active March 29, 2020 19:23
Self signed SSL
openssl genrsa -des3 -out ssl.key 2048
openssl req -new -key ssl.key -out ssl.csr
cp ssl.key ssl.key.orig
openssl rsa -in ssl.key.orig -out ssl.key
openssl x509 -req -days 1095 -in ssl.csr -signkey ssl.key -out ssl.crt
cat ssl.crt ssl.key > ssl.pem
@miguelfrde
miguelfrde / archinstall.md
Last active August 29, 2022 08:29
Preinstalled Windows 8.1 and Arch Linux dual boot

Arch Linux installation (preinstalled Windows 8.1 dual boot)

Before

  1. Disable Windows Fast-Startup
  2. Disable Secure Boot

Partitioning