Skip to content

Instantly share code, notes, and snippets.

@jareware
jareware / s3-curl-backups.md
Last active August 29, 2021 00:56
Simple, semi-anonymous backups with S3 and curl

⇐ back to the gist-blog at jrw.fi

Simple, semi-anonymous backups with S3 and curl

Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl. Hold onto your hats, there's some Bucket Policy acrobatics ahead.

There's also a tl;dr at the very end if you just want the delicious copy-pasta.

Bucket setup

@sheikhwaqas
sheikhwaqas / setup-mysql.sh
Last active September 6, 2023 15:59
Install MySQL Server on Ubuntu (Non-Interactive Installation)
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
# Set the Server Timezone to CST
echo "America/Chicago" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# Enable Ubuntu Firewall and allow SSH & MySQL Ports
ufw enable
ufw allow 22
@jaeschliman
jaeschliman / emacs-set-app-icon.m
Created January 24, 2014 03:18
change the Emacs.app application icon while it's running
/*
I typically run several emacs instances at once,
One handling IM and my timecard etc,
and one for each project I'm currently working on.
This way I can tailor a given instance of emacs to a given project
as much as I want without interfering with the others,
it simplifies buffer-switching and desktop saving etc.
But it gets to be a PITA command-tabbing between them as they all have the same icon.
This fixes that.
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@owainlewis
owainlewis / rails_codes.md
Last active December 20, 2015 13:59
Rails status code symbol mappings

Status Code Status Message Symbol

2xx Success
200	OK	:ok
201	Created	:created
202	Accepted	:accepted
203	Non-Authoritative Information	:non_authoritative_information
204	No Content	:no_content
205	Reset Content	:reset_content
@willurd
willurd / web-servers.md
Last active May 4, 2024 07:22
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@radar
radar / debug.md
Last active December 16, 2015 05:29

FIRST: Have you tried stopping your server process and restarting it?

Now with that out of the way...

Two quick, easy rules to getting help:

  1. Questions concerning problems with code you've written must describe the specific problem and include valid code to reproduce it. See http://SSCCE.org for guidance.
  2. Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: http://goo.gl/9nI4eq.

Please provide the following information in a new Gist:

@tavisrudd
tavisrudd / links.txt
Created March 23, 2013 04:55
some links related to my voice coding talk at #pycon
@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@