Skip to content

Instantly share code, notes, and snippets.

View hoto's full-sized avatar
:octocat:
‏‏‎ Eating github stars for breakfast.

Andrzej Rehmann hoto

:octocat:
‏‏‎ Eating github stars for breakfast.
View GitHub Profile
@dagwieers
dagwieers / gist:5994177
Last active March 28, 2016 19:55
Testing ansible_connection=local
[dag@moria ~]$ cat hosts
localhost ansible_connection=local
[dag@moria ~]$ ansible -i hosts localhost -m ping
localhost | success >> {
"changed": false,
"ping": "pong"
}
[dag@moria ~]$ ansible -vv -i hosts localhost -m ping
<localhost> REMOTE_MODULE ping
@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.

@elgalu
elgalu / dconf-custom-keybindings.sh
Created January 22, 2016 14:38
Sample custom key bindings through dconf-tools cli
# requirements
sudo apt-get install -qyy dconf-tools
# careful, if you already have custom hotkeys this commands will overwrite the first 7 ...
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/name "'SouthWest(7)0,1080'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding "'<Primary><Super>a'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/command "'wmctrl -r :ACTIVE: -e 7,0,1080,-1,-1'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/name "'SouthEast(9)1920,1080'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/binding "'<Primary><Super>d'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/command "'wmctrl -r :ACTIVE: -e 9,1920,1080,-1,-1'"
@OndrejP
OndrejP / docker-register-2-list-images.sh
Last active November 28, 2019 00:52
list all images on Docker Register v2
#!/bin/bash
export Register=https://register.example.com
export cLink="/v2/_catalog?n=10"
export cFile=docker.register.catalog
export tFile=docker.register.tags
export wgetC="wget -O- -q -S "
# Usage with user/password
# export wgetC="wget -O- -q -S --user=ondra --password=heslo "
@ansgarschulte
ansgarschulte / Visual Studio Code eclipse Shortcuts Mac
Created November 30, 2015 09:21
Visual Studio Code eclipse Shortcuts Mac
// Place your key bindings in this file to overwrite the defaults
[
{ "key": "cmd+shift+r", "command": "workbench.action.quickOpen" },
{ "key": "cmd+shift+f", "command": "editor.action.format", "when": "editorTextFocus" },
{ "key": "alt+cmd+down", "command": "editor.action.copyLinesDownAction", "when": "editorTextFocus" },
{ "key": "alt+cmd+up", "command": "editor.action.copyLinesUpAction", "when": "editorTextFocus" },
{ "key": "alt+down", "command": "editor.action.moveLinesDownAction", "when": "editorTextFocus" },
{ "key": "alt+up", "command": "editor.action.moveLinesUpAction", "when": "editorTextFocus" },
{ "key": "cmd+d", "command": "editor.action.deleteLines", "when": "editorTextFocus" },
{ "key": "alt+cmd+r", "command": "editor.action.rename", "when": "editorTextFocus" },
@mpj
mpj / README.md
Last active December 12, 2020 00:15
REALLY quick and dirty static file dev server

Usage

node dirtyserve.js

The point your browser to

http://localhost:3000/myfile.xxx

and the server will try to serve that file from the local server.

@ambakshi
ambakshi / iam-assume-role.sh
Last active October 25, 2021 15:50
Assume an IAM role. An interesting way of doing IAM roles is to give the instance permissions to assume another role, but no actual permissions by default. I got this idea while setting up security monkey: http://securitymonkey.readthedocs.org/en/latest/quickstart1.html#setup-iam-roles.
#!/bin/bash
#
# Assume the given role, and print out a set of environment variables
# for use with aws cli.
#
# To use:
#
# $ eval $(./iam-assume-role.sh)
#
@kevinold
kevinold / .ackrc
Created February 10, 2013 13:54 — forked from hernamesbarbara/.ackrc
#ack is a tool like grep, designed for programmers with large trees of heterogeneous source code
#to install ack, see http://betterthangrep.com/
#to use ack, launch terminal (mac osx) and type 'ack <some_keywords>'
#ack will search all files in the current directory & sub-directories
#here's how I have my config file setup. this file is located on mac osx here
# ~/.ackrc
# Always sort the files
@bittner
bittner / 60-jetbrains.conf
Created September 25, 2015 07:57
Inotify configuration for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm). Create this file with e.g. `sudo vim /etc/sysctl.d/60-jetbrains.conf`
# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm).
# Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu), and
# run `sudo service procps start` or reboot.
# Source: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
#
# More information resources:
# -$ man inotify # manpage
# -$ man sysctl.conf # manpage
# -$ cat /proc/sys/fs/inotify/max_user_watches # print current value in use
@connor
connor / .jshintrc.js
Created January 11, 2012 22:20
jshintrc example
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.