Skip to content

Instantly share code, notes, and snippets.

View pokle's full-sized avatar

Tushar Pokle pokle

View GitHub Profile
@pokle
pokle / gist:8613660
Created January 25, 2014 08:58
another-key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDa2oHKzZIqdsO8Kxz9Sw+KqlIIJ74H2sR7p2O9ob1qpW/ahlxmCCXAzPADn7WIvpXkYnUA9bEyYLNYICgdavvNuQ8Ay6KERlPf6S1fLaf6L39je65xRBIZ1uEoRWCR6hhybFxKKqcmVW80m5jEuek7EBKlcHFyjKku9eyRTiL9zYDB5qP8gFb5LuJzbSNXJOnBqbTmiuSaGR2FCji7XLrHImpkp1yBqcd6uuRb5n/u5op45NOSfn2o79koLjdSQJT9yZHmc25foJf+sIUyG7OyaL2hWdv+CzzijoJ3MprxBXgRbzR+Um8OY4fh0d3oYSCH8c/nFnddf1Vqn5p5j6H/ [email protected]
@pokle
pokle / install-oracle-jdk.sh
Last active August 29, 2015 13:56
Install Oracle JDK on Centos / Redhat
wget --no-check-certificate \
--no-cookies \
--header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" \
"http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.rpm" \
--output-document /tmp/jdk.rpm &&
yum install -y /tmp/jdk.rpm
@pokle
pokle / gist:9271432
Last active August 22, 2017 16:01
Automatically mount the EC2 ephermal SSDs as raid0 on Ubuntu

Launch your EC2 EBS instance with two SSDs on the second and third slots (after the root EBS volume), with this in your userdata:

#!/usr/bin/env bash

umount /dev/xvdb
umount /dev/xvdc
apt-get install mdadm -y
mkdir /u01

cat > /etc/init/mount-ephermal-ssd.conf <

@pokle
pokle / list-dir.clj
Created March 17, 2014 01:21
How to list a directory in Clojure
(map str (file-seq (clojure.java.io/as-file "/some/directory")))
@pokle
pokle / Dockerfile
Created April 16, 2014 04:45
Run ssh server inside a Centos/Redhat Docker container
# ssh server
# Don't forget to run '/usr/sbin/sshd -D' if you actually want to ssh into this container
RUN yum install -y openssh-server
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
ADD src/sshd/sshd_config /etc/ssh/sshd_config
RUN echo root:welcome1 | chpasswd
@pokle
pokle / pepl.pl
Created February 21, 2015 08:17
Tiny perl repl
#!/usr/bin/env rlwrap perl
$_='"Welcome to the perl repl"';
do {
$result = eval($_);
print $@ if ($@);
print $result, "\n" if defined $result;
print 'pepl> ';
} while (<>);
@pokle
pokle / login.html
Created June 4, 2015 06:02
Super simple login form
<!DOCTYPE html>
<html>
<head>
<title>CSSO</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<form class="form" action="/login">
events {
worker_connections 1024;
}
http {
server {
listen 80;
location = / {
return 302 http://localhost/a/b/c;
@pokle
pokle / nginx.conf
Created August 21, 2015 03:45
Minimal nginx configuration showing some basic things
# Save this as nginx.conf
# stop with: sudo nginx -s stop
# start with: sudo nginx -p . -c nginx.conf
events {
worker_connections 1024;
}
http {
server {
#!/usr/bin/env perl
#
# Major device number counts of the home files at http://sylab-srv.cs.fiu.edu/doku.php?id=projects:iodedup:start
#
# run like this: perl counts.pl homes-*
use strict;
my %count = ();