Skip to content

Instantly share code, notes, and snippets.

@keedi
keedi / nginx-error.conf
Created October 27, 2017 16:59 — forked from cbednarski/nginx-error.conf
Example nginx.conf for custom error pages
server {
listen 80;
server_name HOSTNAME;
root /opt/PATH/;
index index.html;
rewrite ^/$ /en/PATH/ redirect;
@keedi
keedi / ssl-cert-info.sh
Created October 27, 2017 08:43
Shell script to check SSL certificate info like expiration date and subject. Taken from http://giantdorks.org/alain/shell-script-to-check-ssl-certificate-info-like-expiration-date-and-subject/
#!/bin/bash
usage()
{
cat <<EOF
Usage: $(basename $0) [options]
This shell script is a simple wrapper around the openssl binary. It uses
s_client to get certificate information from remote hosts, or x509 for local
certificate files. It can parse out some of the openssl output or just dump all
@keedi
keedi / tmux.md
Created October 11, 2017 21:09 — forked from andreyvit/tmux.md
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

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@keedi
keedi / upload_snap.js
Created June 29, 2017 17:13 — forked from Tamal/upload_snap.js
React Native File upload using XMLHttpRequest
_uploadSnap() {
var url = 'http://example.com/upload'; // File upload web service path
var photo = {
uri: this.state.picturePath, // CameralRoll Url
type: 'image/jpeg',
name: 'photo.jpg',
};
var formData = new FormData();
formData.append("file", photo);
use strict;
use Tie::IxHash;
use JSON::PP;
# magic start
my $obj_parser_sub = \&JSON::PP::object;
*JSON::PP::object = sub {
tie my %obj, 'Tie::IxHash';
$obj_parser_sub->(\%obj);

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

#!/bin/bash
WIDTH=1280
HEIGHT=800
x11_cmd=x11vnc
if [[ ! -z $(pgrep ${x11_cmd}) ]]; then
pkill ${x11_cmd}
fi
#!/usr/bin/perl
use strict;
use warnings;
use AnyEvent;
use AnyEvent::Socket qw/tcp_server/;
use AnyEvent::Handle;
my %conns;
@keedi
keedi / gist:7686327
Last active December 29, 2015 14:49
2013년 Seoul.pm 성탄절 달력을 준비 중입니다.
따로 CFP는 없지만, 금년 게재를 원하시는 분께서는
게재 희망일 최소 3일 전에 제게 메일로 전달 주시면 됩니다.
keedi.k @ gmail.com
github이 편하신 분은 https://github.com/seoulpm/seoulpm-advent-calendar
저장소를 포크하신 후 2013/drafts/README 문서를 정독하시고
2013/drafts/ 하부 디렉터리에 기사를 pull-request 해주시면 됩니다.