Skip to content

Instantly share code, notes, and snippets.

@lucaspiller
lucaspiller / generate.sh
Created September 15, 2021 16:07
OpenSSL Client Certificates
# Extra: Generate self-signed server certificate
openssl req -nodes -new -x509 -keyout server.key -out server.crt -days 3650
# Generate CA for client certificates
openssl req -nodes -new -x509 -keyout client-ca.key -out client-ca.crt -days 3650 -subj "/CN=Client CA/O=My Company Name LTD./C=US"
# Set client name which will be used as CN
export CLIENT=bob
# Generate CSR for client certificate
@lucaspiller
lucaspiller / .gitlab-ci.yml
Last active April 14, 2022 09:07
Rails 5.2 + Docker + Gitlab Continuous Deployment
image: ruby:2.6
services:
- postgres:11-alpine
variables:
POSTGRES_DB: myorg_test
CONTAINER_IMAGE: registry.gitlab.com/myorg/myapp
stages:
diff --git a/Gemfile b/Gemfile
index bfc2a1de..8de952c3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,9 +2,9 @@ source 'https://rubygems.org'
ruby '2.4.1'
-gem 'rails', '5.0.2'
+gem 'rails', '5.1.0'
Disk encryption benchmarks:
$ cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1 352344 iterations per second
PBKDF2-sha256 196215 iterations per second
PBKDF2-sha512 156784 iterations per second
PBKDF2-ripemd160 237449 iterations per second
PBKDF2-whirlpool 73470 iterations per second
# Algorithm | Key | Encryption | Decryption
# pacman -S gnome
:: There are 47 members in group gnome:
:: Repository extra
1) adwaita-icon-theme 2) baobab 3) dconf-editor 4) empathy 5) eog 6) epiphany 7) evince 8) gdm 9) gnome-backgrounds 10) gnome-calculator 11) gnome-contacts
12) gnome-control-center 13) gnome-dictionary 14) gnome-disk-utility 15) gnome-font-viewer 16) gnome-keyring 17) gnome-screenshot 18) gnome-session
19) gnome-settings-daemon 20) gnome-shell 21) gnome-shell-extensions 22) gnome-system-log 23) gnome-system-monitor 24) gnome-terminal 25) gnome-themes-standard
26) gnome-user-docs 27) gnome-user-share 28) grilo-plugins 29) gtk3-print-backends 30) gucharmap 31) gvfs 32) gvfs-afc 33) gvfs-goa 34) gvfs-google 35) gvfs-gphoto2
36) gvfs-mtp 37) gvfs-nfs 38) gvfs-smb 39) mousetweaks 40) mutter 41) nautilus 42) sushi 43) totem 44) tracker 45) vino 46) xdg-user-dirs-gtk 47) yelp
Enter a selection (default=all):
@lucaspiller
lucaspiller / _fields.html.slim
Last active June 26, 2021 23:03
Reform 2.2 nested form (with support for cocoon gem)
= f.simple_fields_for :inputs do |input|
= render 'input_fields', f: input
.links
= link_to_add_association f, :inputs, partial: 'input_fields', force_non_association_create: true do
Add
@lucaspiller
lucaspiller / find-test.sh
Created July 20, 2016 15:25
Lightify GU10 - Pair with Hue hub and test
#!/bin/bash
bridgeuser="" # Bridge user, see the API docs for this http://www.developers.meethue.com/documentation/configuration-api#71_create_user
bridgeip="" # Bridge IP address
lamp=$1 # The lamp number, usage ./find-test 5
curl -X POST "http://$bridgeip/api/$bridgeuser/lights"
echo $?
@lucaspiller
lucaspiller / openttd-reddit.rb
Last active April 10, 2016 15:09
OpenTTD (Reddit Version) Homebrew formula for OS X
# Install like this:
#
# $ brew install https://gist.githubusercontent.com/lucaspiller/29fdd47956dd38a1fc0a1d4fd877b052/raw/openttd-reddit.rb
#
# To symlink to /Applications/OpenTTD.app run:
#
# $ brew linkapps openttd-reddit
#
# Custom game data files / configuration / saves are stored in ~/Documents/OpenTTD/
#
Timestamp Temperature (C) Humidity (RH) Voltage (V)
2016-02-16 03:45:51.530868318 +0000 UTC -3.1 84.8 3.812
2016-02-16 03:50:41.837109716 +0000 UTC -3.1 84.8 3.806
2016-02-16 03:55:31.840826361 +0000 UTC -3.1 85 3.808
2016-02-16 04:00:22.152985775 +0000 UTC -3.1 84.9 3.805
2016-02-16 04:05:12.152659933 +0000 UTC -3.1 85.3 3.807
2016-02-16 04:10:02.032545988 +0000 UTC -3.1 85 3.802
2016-02-16 04:14:52.157674259 +0000 UTC -3.1 84.7 3.799
2016-02-16 04:19:42.160287768 +0000 UTC -3.2 84.5 3.8
2016-02-16 04:24:32.185451128 +0000 UTC -3.2 84.2 3.801
@lucaspiller
lucaspiller / Gemfile
Last active April 22, 2016 02:03
photos2tidy.rb - scripts to free your photos from Photos.app
source "httpso://rubygems.org"
gem 'sqlite3'
gem 'exiftool'