Skip to content

Instantly share code, notes, and snippets.

View cmndrsp0ck's full-sized avatar
🖖
Fascinating

Fabian B. cmndrsp0ck

🖖
Fascinating
View GitHub Profile
@jagregory
jagregory / gist:710671
Created November 22, 2010 21:01
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@jayjanssen
jayjanssen / gist:4039319
Created November 8, 2012 15:02
sysctl tuning for HAproxy
net.core.somaxconn = 32768
net.ipv4.conf.all.send_redirects = 1
net.ipv4.ip_nonlocal_bind = 1
net.ipv4.tcp_abort_on_overflow = 0
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_max_tw_buckets = 262144
net.ipv4.tcp_mem = 200000    280000    300000
@barberj
barberj / tmux_cheatsheet.markdown
Last active May 11, 2023 07:31 — forked from henrik/tmux_cheatsheet.markdown
add move pane into new window. change window commands to some of my aliases

tmux cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ninadsp
ninadsp / README.md
Last active August 26, 2022 15:06
Use jq to conditionally pick up fields from a JSON
  • 1.json contains data retrieved from the Instagram API. data is an array of media matching the query posted to Instagram's REST API, in a JSON array.
  • Each media element contains metadata for a photo/video posted to Instagram
  • .data[] loops over each media object in the JSON file, letting us process each element
  • | works like a regular *nix pipe, taking the output of the previous operator and passing it on to the next one.
  • select() filters through objects depending on the rule passed to it.
  • .tags[] returns an array of tags for each media. contains() returns true if the current object passed to it contains the string passed as a parameter. .tags[] | contains("100happydays") iterates over all the tags associated with the media object and returns true if the current tag matches the string 100happydays.
  • .select( .tags[] | contains("100happydays") ) filters all media objects that contain the tag 100happydays
  • .images.standard_resolution.url now
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 22, 2024 17:32
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@drmalex07
drmalex07 / getopt-example.sh
Last active May 3, 2024 03:03
A small example on Bash getopts. #bash #getopt #getopts
#!/bin/bash
#
# Example using getopt (vs builtin getopts) that can also handle long options.
# Another clean example can be found at:
# http://www.bahmanm.com/blogs/command-line-options-how-to-parse-in-bash-using-getopt
#
aflag=n
bflag=n
@LeoIannacone
LeoIannacone / monokai-exteded.xml
Last active October 26, 2023 15:50
Monokai Extended - GtkSourceView Theme
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2014 Leo Iannacone <info@leoiannacone.com>
This file was generated from a textmate theme named Monokai Extended
with tm2gtksw2 tool. (Alexandre da Silva)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active May 23, 2024 16:51
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line