Skip to content

Instantly share code, notes, and snippets.

View willgarcia's full-sized avatar
🌴

William Garcia willgarcia

🌴
  • Brisbane, Australia
View GitHub Profile
# Index tracker and rebalancer
## Installation
```
npm install
```
## Configuration and usage

Keybase proof

I hereby claim:

  • I am willgarcia on github.
  • I am willgarcia (https://keybase.io/willgarcia) on keybase.
  • I have a public key ASDByKo0el7Rv-t3cgFr5SVn_1AG4gWUo4hetLx1gfjT_Ao

To claim this, I am signing this object:

@willgarcia
willgarcia / iterm
Created September 2, 2017 09:00
iterm
brew update; brew upgrade --cleanup; brew cask cleanup; brew prune; brew cleanup --force; upgrade_oh_my_zsh; istats
@willgarcia
willgarcia / delete-version-lambda
Created August 21, 2017 10:48
delete-version-lambda
0 🍒 chatbot/ $ for i in $(seq 5 100); do aws lambda delete-function --function-name chatbot-FBMessageEvent-DWQ6NCE7L0C5 --qualifier $i --region us-east-1; done

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@willgarcia
willgarcia / aws-cleanup.sh
Created January 31, 2017 04:54
Delete all AWS resources (lambdas, cloudfront distribs, ec2, lb, api-gateways, ...)
#!/bin/bash
set -e
AWS_FUNCTIONS=$(aws lambda list-functions --query "Functions[].FunctionArn")
for func in $AWS_FUNCTIONS
do
CMD="aws lambda delete-function --function-name $func"
echo $CMD
$CMD
source 'https://rubygems.org'
gem "table_print"
@willgarcia
willgarcia / puppet3-inherit-classdep
Created September 18, 2016 13:06
puppet3-inherit-classdep
class test::config inherits test::params {
exec {
"hello":
command => "/bin/mv ${file} /tmp/test",
require => Class['test::install'],
}
}
class test {
$foo = [
@willgarcia
willgarcia / puppet3-loop
Created September 15, 2016 11:20
puppet3-loop
class test {
$foo = [
{'volume' => '/tmp/vol1', 'size' => '60'},
{'volume' => '/tmp/vol2', 'size' => '600'},
]
define myResource {
$file_path = "${name['volume']}/${name['size']}"
file { $file_path:
OS X and Linux
Removing Prey from Unix-based systems is quite straightforward. You just need to open a terminal (OS X, Linux) and run the following command:
sudo /usr/lib/prey/current/bin/prey config hooks pre_uninstall && sudo rm -rf /usr/lib/prey /var/log/prey.log /etc/prey
That will effectively delete all traces of Prey from your system.
Android
Prey for Android is a bit difficult to remove because thieves shouldn't have it easy. If you're sure you don't need this protection anymore, please follow these instructions:
On the device, go to Global Settings > Security > Device administrators.
Disable permissions for Prey.