Skip to content

Instantly share code, notes, and snippets.

View ecelis's full-sized avatar
🏹
📷 🥊

Ernesto Celis ecelis

🏹
📷 🥊
View GitHub Profile
@ecelis
ecelis / install_aseprite.sh
Created February 14, 2021 06:35 — forked from tobiasvl/install_aseprite.sh
The commands to build aseprite on Fedora
# Copied from https://github.com/aseprite/aseprite/blob/master/INSTALL.md#skia-on-linux
sudo yum install -y gcc-c++ cmake ninja-build libX11-devel libXcursor-devel mesa-libGL-devel fontconfig-devel
mkdir $HOME/deps
cd $HOME/deps
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
git clone -b aseprite-m71 https://github.com/aseprite/skia.git
export PATH="${PWD}/depot_tools:${PATH}"
cd skia
@ecelis
ecelis / cw-monitor-memusage.py
Last active March 21, 2018 20:09 — forked from shevron/LICENSE
Send EC2 instance memory usage stats to CloudWatch using boto and IAM Roles
#!/usr/bin/env python
'''
Copyright (c) 2015, Shahar Evron
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
@ecelis
ecelis / default.conf
Created August 30, 2016 12:59 — forked from alanbriolat/default.conf
nginx userdir + PHP-FPM
server {
listen 80;
server_name localhost;
# ... other default site stuff, document root, etc. ...
location ~ ^/~(?<userdir_user>.+?)(?<userdir_uri>/.*)?$ {
alias /home/$userdir_user/public_html$userdir_uri;
index index.html index.htm index.php;
autoindex on;
@ecelis
ecelis / imaway
Created May 23, 2016 13:54 — forked from sdague/imaway
dbus xchat integration
#!/usr/bin/python
import dbus
import dbus.glib
import gobject
import subprocess
def lock():
print "Screen saver turned on"
@ecelis
ecelis / gpg-import-and-export-instructions.md
Created October 18, 2015 03:26 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
var serialport = require('node-serialport')
var sp = new serialport.SerialPort("/dev/ttyO3", {
parser: serialport.parsers.raw,
baud: 9600
})
sp.on('data', function(chunk) {
console.log(chunk.toString('hex'), chunk.toString(), chunk)
})