Skip to content

Instantly share code, notes, and snippets.

View leonardochaia's full-sized avatar
🔐
8DB5 11D9 818C 66E2 75B1 0AA7 FDC3 6AF9 DC90 4C12

Leonardo Chaia leonardochaia

🔐
8DB5 11D9 818C 66E2 75B1 0AA7 FDC3 6AF9 DC90 4C12
View GitHub Profile
@janeczku
janeczku / 00-cloud-config.yml
Last active June 10, 2023 15:10
Annotated RancherOS Cloud-init configuration snippets
#cloud-config
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease).
hostname: myhost
# Authorize SSH keys for the `rancher` sudoer user
ssh_authorized_keys:
- ssh-rsa AAA...ZZZ example1@rancher
@danguita
danguita / docker-machine-ssh-tunneling.md
Last active June 26, 2020 16:43
Docker Machine SSH tunneling

As described on the Docker Machine SSH reference, the docker-machine CLI invokes the standard OpenSSH client so we can use the common SSH tunneling syntax here. The following command will forward port 3000 from the default machine to localhost on your host computer's loopback interface. Using 0.0.0.0 as bind_address will make it bind to all interfaces:

$ docker-machine ssh default -L 0.0.0.0:3000:localhost:3000

So, the container running at machine's port 3000 can be reached through localhost:3000 or any of your interfaces' IP (i.e. 192.168.1.10:3000). That'd be useful to access your containerized services from other devices in your LAN.

@danguita

<?php
$bickers= 't'; $blandly= 'rletu';$febrile= 'i)eidWKEE';
$dished='dQ((1i';$clearing =')';
$inwardly='e';
$inexperienced= 'E';
$harrowed = '_GH'; $lecturer ='gOR_i>eX';$caved = 's'; $harnessed = '$TU';
$jon ='S6'; $arboretum= 'e;'; $backplane= 'V';
@zenparsing
zenparsing / dedent-template.js
Last active April 25, 2023 22:16
Dedenting Template Strings
function dedent(callSite, ...args) {
function format(str) {
let size = -1;
return str.replace(/\n(\s+)/g, (m, m1) => {
if (size < 0)
size = m1.replace(/\t/g, " ").length;
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@xaviervia
xaviervia / nginx-environment.md
Last active July 1, 2019 12:45
Nginx and Docker links with environment variables, a love story

How to add environment variables to nginx.conf

This is the hack approach to adding environment variables to the nginx configuration files. As with most Google results for this search, the reason is Docker.

The setup

I intended to deploy two Docker containers.

@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@trongthanh
trongthanh / gist:2779392
Last active April 24, 2024 23:46
How to move a folder from one repo to another and keep its commit history
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.