Skip to content

Instantly share code, notes, and snippets.

@lfallet
lfallet / forticlient_vpn.exp
Last active September 30, 2017 09:38
Open forticlient SSL VPN without user interaction (using expect)
#!/usr/bin/expect
# installation : sudo apt-get update && sudo apt-get install expect
# configuration: vi my_vpn.exp # then edit lines 8 to 11
# usage : ./my_vpn.exp'
##### configuration #####
set host w.x.y.z
set port 443
set user foo@bar.com
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@lfallet
lfallet / raspberry.md
Last active May 26, 2016 06:23
Raspberry setup

install steps

  • ⚠️ extend partition on the SD card with raspi-config, otherwise won't startx next time
  • sudo apt-get update && apt-get install -y python-serial python-smbus i2c-tools

Flask install

  • sudo pip install virtualenv
  • . venv/bin/activate to activate the env in the specified folder
  • pip install flask

communication through I2C

Every morning, pick 3 things to tackle. You can accomplish more when you focus on only a few things at a time.

When you don't have enough time for a task, think 4D: delete it, defer it, delegate it or diminish it.

Apply the Pareto principle: focus on the 20% of your work that will generate 80% of results.

Be biaised for action. If something will take only one hour to try, don't spend two hours debating it. Just try it!

From Asana

@lfallet
lfallet / heroku_cheatsheet.sh
Created September 16, 2015 08:25
Heroku cheatsheet
git push heroku master # déployer
heroku run rake db:migrate
heroku run rake db:seed
heroku run rails c
heroku logs --tail
heroku config:set ENV_VAR=env_value
@lfallet
lfallet / pgsql_table_size.sql
Last active August 29, 2015 13:55
Tables size in PostgreSQL database
SELECT
relname as "Table",
pg_size_pretty(pg_total_relation_size(relid)) As "Size",
pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as "External Size"
FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC;