Skip to content

Instantly share code, notes, and snippets.

View markstos's full-sized avatar

Mark Stosberg markstos

View GitHub Profile
@tribut
tribut / mosh_pc.sh
Last active June 4, 2018 11:33
wrapper for mosh to work with ssh's proxycommand directive. this only makes sense if the target machine is directly reachable from the internet using udp (but probably not via tcp). usage: mosh_pc.sh [host as mentioned in .ssh/config] [public ip of host]
#!/bin/sh
# ########################################################## #
# wrapper for mosh to work with ssh's proxycommand directive #
# this only makes sense if the machine is directly reachable #
# from the internet using udp. #
# ########################################################## #
THISSCRIPT="`basename \"$0\"`"
REMOTE="$1"
@uzyexe
uzyexe / logentires-systemd
Last active June 4, 2018 20:42
systemd: Sending your CoreOS data to Logentries
[Unit]
Description=logentires.service
[Service]
Environment=ACCESS_TOKEN=YOUR_LOGENTRIES_ACCESS_TOKEN
ExecStart=/bin/sh -c 'journalctl -o short -f | sed \"s/^/${ACCESS_TOKEN} \\0/g\" | ncat data.logentries.com 10000'
@nathansmith
nathansmith / sprintly.bash
Last active July 18, 2018 15:23
Used to export Sprint.ly data to CSV format.
# Sprint.ly Export
alias sprintly='cd ~/sprintly-csv/ && curl -s -u name@example.com:API_KEY "https://sprint.ly/api/products/PRODUCT_ID/items.csv?status=backlog,in-progress,accepted,someday,completed&limit=99999" > temp.csv && iconv -f utf-8 -t cp1250 temp.csv > sprintly_$(date +"%Y-%m-%d_%I-%M-%S").csv && rm temp.csv && open .'
@rudism
rudism / qutebrowser-pinboard.sh
Created March 30, 2017 22:39
Qutebrowser userscript to add current page to Pinboard.in bookmarks
#!/bin/sh
# Uncomment and add your pinboard token here or export it globally somewhere
# PINBOARD_API_TOKEN="username:token"
# Put this file in ~/.local/share/qutebrowser/userscripts and chmod +x
# Run it from Qutebrowser with :spawn --userscript qutebrowser-pinboard.sh
# Bind it to "A" key with :bind --mode normal A spawn --userscript qutebrowser-pinboard.sh
API_HOST="https://api.pinboard.in/v1"
@yorkxin
yorkxin / README.md
Last active October 27, 2020 12:17
Amazon S3 Redirect Rules Generator

Amazon S3 Redirect Rules Generator

A Ruby script to generate simple Amazon S3 Redirection Rules XML file.

Update: There is an app for that now! Use Amazon S3 Redirector (Web app) and you can generate the XML without any knowledge about Ruby. Thanks to @rainforestapp. BTW, It's open source too.

Dependencies

  • Nokogiri
@alexblackie
alexblackie / jellybeans.ini
Created January 28, 2016 06:14
Gnome Terminal profile for jellybeans
# dconf dump /org/gnome/terminal/legacy/profiles:/
[:b1dcc9dd-5262-4d8d-a863-c897e6d979b9]
foreground-color='rgb(173,173,173)'
visible-name='Jellybeans'
login-shell=true
palette=['rgb(59,59,59)', 'rgb(207,106,76)', 'rgb(153,173,106)', 'rgb(216,173,76)', 'rgb(89,123,197)', 'rgb(160,55,176)', 'rgb(113,185,248)', 'rgb(173,173,173)', 'rgb(99,99,99)', 'rgb(247,146,116)', 'rgb(193,213,146)', 'rgb(255,213,116)', 'rgb(129,163,237)', 'rgb(200,95,216)', 'rgb(153,225,255)', 'rgb(213,213,213)']
default-size-rows=45
default-size-columns=160
use-system-font=false
use-theme-colors=false
@ha7ilm
ha7ilm / i3.conf
Last active October 22, 2021 16:11
Prompt to rename current workspace in i3 so that the new name starts with the number of the current workspace, e.g. "1:term"
bindsym $mod+u exec i3-input -F "rename workspace to \"$(i3-msg -t get_workspaces | jq -r \"map(select(.focused))[0].num\"):%s\"" -P 'New name for this workspace: '
@simonplend
simonplend / parseargs-example.mjs
Last active June 5, 2022 06:17
Example using new experimental Node.js parseArgs method (https://nodejs.org/api/util.html#utilparseargsconfig) - more new features covered at https://github.com/simonplend/whats-new-in-node-js-core
import { parseArgs } from "node:util";
const args = parseArgs({
options: {
name: {
type: "string",
},
verbose: {
type: "boolean",
short: "v",
@sergejmueller
sergejmueller / nginx.conf
Last active August 18, 2022 08:44
Stop search engines from indexing .txt, .log, .xml, .css and .js files in Nginx
location ~* \.(txt|log|xml|css|js)$ {
add_header X-Robots-Tag noindex;
}
@grafov
grafov / part-of-sway-config
Created April 3, 2021 14:08
Configuration for the remapping Kensington Expert Mouse buttons for Sway WM
# Copypaste it to your ~/.config/sway/config
set $TBALL 1149:4128:Kensington______Kensington_Expert_Mouse
# Turns on scrolling with the ball when right bottom button pressed.
input $TBALL {
scroll_method on_button_down
scroll_button 273
}