Create a brand new ed25519 key pair
ssh-keygen -o -a 100 -t ed25519
Get the pub key and put the result in your lxd default profile
cat ~/.ssh/ed25519.pub
lxc profile edit default
| CREATE ROLE owner LOGIN ENCRYPTED PASSWORD 'secret' CONNECTION LIMIT 3; | |
| ALTER ROLE owner SET statement_timeout = 20000; | |
| ALTER ROLE owner SET lock_timeout = 3000; | |
| ALTER ROLE owner SET idle_in_transaction_session_timeout = 3000; -- v9.6+ | |
| CREATE ROLE readwrite_users NOLOGIN; | |
| CREATE ROLE readonly_users NOLOGIN; | |
| CREATE DATABASE exampledb WITH OWNER owner ENCODING UTF8 LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8'; |
Create a brand new ed25519 key pair
ssh-keygen -o -a 100 -t ed25519
Get the pub key and put the result in your lxd default profile
cat ~/.ssh/ed25519.pub
lxc profile edit default
| [ | |
| { | |
| "city": "New York", | |
| "growth_from_2000_to_2013": "4.8%", | |
| "latitude": 40.7127837, | |
| "longitude": -74.0059413, | |
| "population": "8405837", | |
| "rank": "1", | |
| "state": "New York" | |
| }, |
| -- Two dashes start a one-line comment. | |
| --[[ | |
| Adding two ['s and ]'s makes it a | |
| multi-line comment. | |
| --]] | |
| ---------------------------------------------------- | |
| -- 1. Variables and flow control. | |
| ---------------------------------------------------- |
| ... | |
| # ==> Configuration for any authentication mechanism | |
| # Configure which keys are used when authenticating a user. The default is | |
| # just :email. You can configure it to use [:username, :subdomain], so for | |
| # authenticating a user, both parameters are required. Remember that those | |
| # parameters are used only when authenticating and not when retrieving from | |
| # session. If you need permissions, you should implement that in a before filter. | |
| # You can also supply a hash where the value is a boolean determining whether | |
| # or not authentication should be aborted when the value is not present. | |
| config.authentication_keys = [ :login ] |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| #!/usr/bin/env python | |
| ''' | |
| Based on http://ginstrom.com/scribbles/2012/05/10/continuous-integration-in-python-using-watchdog/ | |
| Dependencies: ``watchdog`` (pip install watchdog) | |
| Montiors the whole tree for changes. | |
| Check for all changes to any files and test the associated package; we might want to test changes to a pyramid test.ini, say, or a file rename as part of a refactor. |
| ## The Problem | |
| Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.) | |
| ## The temptingly easy but ultimately wrong solution: | |
| Alter the port the script talks to from 8000 to 80: | |
| }).listen(80); |
| #!/usr/bin/env python | |
| # Ejabberd extauth : Authenticate phpbb users against PostgreSQL with Peewee | |
| # Original Author: Lukas Kolbe <[email protected]> | |
| import sys | |
| import logging | |
| import struct | |
| from hashlib import md5 |
| # Convert any YouTube video into an audio file you can listen to on the go, using: | |
| # http://rg3.github.com/youtube-dl/ | |
| { ~ } > brew install ffmpeg | |
| { ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl | |
| { ~ } > chmod u+x youtube-dl | |
| # Pick which video format you want to download.. (use any YT video link) | |
| { ~ } > ./youtube-dl -s -F http://www.youtube.com/watch?v=vT1KmTQ-1Os |