Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
use Mysql;
use strict;
use vars qw($school_name);
use vars qw($pass);
require "./cgi-lib.pl";
#
# Tested on OS X 10.9.2 (MacBook Air) with Perl 5.18.2 and EV 4.17 (kqueue)
#
# 280.9MB memory usage, 0% CPU usage once roundtrips are finished after 29s
# (with all 10k sockets still open)
#
# Get the latest version of Mojolicious from http://github.com/kraih/mojo
# $ sudo sysctl -w kern.maxfiles=40960 kern.maxfilesperproc=20480
# $ ulimit -n 20480
# $ LIBEV_FLAGS=8 perl c10k_client.pl
@hernan604
hernan604 / player.pl
Last active August 29, 2015 14:08 — forked from jberger/player.pl
# MY MODIFIED PLAYER
# ** * * DOESNT WORK ON FIREFOX * * * ONLY ON CHROME * * *
# must install AudioFile::Plugins in order to work: cpanm AudioFile::Info::MP3::Info
#!/usr/bin/env perl
use strict;
use warnings;
use Mojolicious::Lite;
use AudioFile::Find;
use AudioFile::Info;
use File::Spec;
use Mojo::Base -strict;
use Devel::Cycle;
use Mojo::UserAgent;
use Promises 'deferred';
my $ua = Mojo::UserAgent->new;
sub fetch_it {
my $url = shift;
my $d = deferred();
@hernan604
hernan604 / chat.pl
Last active August 29, 2015 14:15 — forked from jberger/chat.pl
#!/usr/bin/env perl
use Mojolicious::Lite;
use Mojo::Redis2;
use experimental 'signatures';
helper redis => sub { state $r = Mojo::Redis2->new };
get '/' => 'chat';
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl -L https://npmjs.org/install.sh | sh
@hernan604
hernan604 / multiple_ssh_setting.md
Created January 7, 2016 22:14 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@hernan604
hernan604 / README.md
Created March 17, 2017 00:59 — forked from dbiesecke/README.md
FUSE Tips & Tricks

Basic

Example invocation using sshfs:

`afuse -o mount_template="sshfs %r:/ %m" \
        -o unmount_template="fusermount -u -z %m" \
           mountpoint/`

Now try ls mountpoint/user@host/.

Basic
=====
[Shift]+[Mod]+[Enter] - launch terminal.
[Mod]+[b] - show/hide bar.
[Mod]+[p] - dmenu for running programs like the x-www-browser.
[Mod]+[Enter] - push acive window from stack to master, or pulls last used window from stack onto master.
[Mod] + [j / k] - focus on next/previous window in current tag.
@hernan604
hernan604 / nginx
Created May 16, 2020 19:56 — forked from vdel26/nginx
Openresty init.d script
#!/bin/sh
#
# chkconfig: 2345 55 25
# Description: Nginx init.d script, put in /etc/init.d, chmod +x /etc/init.d/nginx
# For Debian, run: update-rc.d -f nginx defaults
# For CentOS, run: chkconfig --add nginx
#
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all