Skip to content

Instantly share code, notes, and snippets.

View ceremcem's full-sized avatar

Cerem Cem ASLAN ceremcem

View GitHub Profile
@bmarwell
bmarwell / .netrc
Last active December 20, 2019 23:08 — forked from gbrks/btrfs-scrub
btrfs scrub: script and systemd timers to run weekly and send mails using gmail via curl + netrc
machine smtp.gmail.com
login user@gmail.com
password my-app-password
@frgomes
frgomes / install-docker.sh
Last active June 6, 2021 18:52
Debian - install docker in Debian Jessie
#!/bin/bash
# compiled from https://docs.docker.com/engine/installation/linux/debian/#/debian-jessie-80-64-bit
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get install apt-transport-https ca-certificates -y
sudo sh -c "echo deb https://apt.dockerproject.org/repo debian-jessie main > /etc/apt/sources.list.d/docker.list"
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
@edsu
edsu / replies.py
Last active December 7, 2022 18:59
Try to get replies to a particular set of tweets, recursively.
#!/usr/bin/env python
"""
Twitter's API doesn't allow you to get replies to a particular tweet. Strange
but true. But you can use Twitter's Search API to search for tweets that are
directed at a particular user, and then search through the results to see if
any are replies to a given tweet. You probably are also interested in the
replies to any replies as well, so the process is recursive. The big caveat
here is that the search API only returns results for the last 7 days. So
@campsjos
campsjos / index.html
Created November 17, 2015 19:29
Paper.js canvas responsive resizing
<html>
<head>
<style>
#canvas {
width:100%;
}
</style>
</head>
<body>
<canvas id="canvas" width="800" height="600" resize />
@mmaelzer
mmaelzer / gist:8e6eda9bd9750921bb01
Created June 24, 2015 04:18
mjpeg-camera + socket.io
/** =========================== SERVER =================================== */
var io = require('socket.io')(server);
var MjpegCamera = require('mjpeg-camera');
server.listen(3000);
// Create an MjpegCamera instance
var camera = new MjpegCamera({
name: 'backdoor',
url: 'http://192.168.7.1/video'
@nolanlawson
nolanlawson / proxy.txt
Created February 19, 2015 20:25
CouchDB in an Nginx reverse proxy
# this is the config I always use, to route http://mysite.com/couchdb to localhost:5984.
location /couchdb {
rewrite /couchdb(.*) $1 break;
proxy_pass http://127.0.0.1:5984;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
@gmanau
gmanau / nginx-socketio-ssl-reverse-proxy.conf
Last active March 25, 2024 12:15
How to setup nginx as nodejs/socket.io reverse proxy over SSL
upstream upstream-apache2 {
server 127.0.0.1:8080;
}
upstream upstream-nodejs {
server 127.0.0.1:3000;
}
server {
listen 80;
@dalhundal
dalhundal / namecheap-ddns.sh
Created May 4, 2014 16:48
Shell script to update namecheap.com dynamic dns for a domain with your external IP address
#!/bin/sh
# Shell script to update namecheap.com dynamic dns
# for a domain to your external IP address
HOSTNAME=yoursubdomain
DOMAIN=yourdomainname.com
PASSWORD=y0urp455w0rd
IP=`curl -s echoip.com`
@jedi4ever
jedi4ever / broker.js
Last active October 1, 2021 13:39
xsub , xpub example in nodejs
var pubListener = 'tcp://127.0.0.1:5555';
var subListener = 'tcp://127.0.0.1:5556';
var hwm = 1000;
var verbose = 0;
// The xsub listener is where pubs connect to
var subSock = zmq.socket('xsub');
subSock.identity = 'subscriber' + process.pid;
subSock.bindSync(subListener);
@ykhs
ykhs / fizzbuzz.ls
Created August 30, 2012 03:01
fizzbuzz with LiveScript
global <<< require \prelude-ls
fizzbuzz = (x) ->
| x % 15 is 0 => \fizzbuzz
| x % 5 is 0 => \buzz
| x % 3 is 0 => \fizz
| otherwise => x
[1 to 100] |> map fizzbuzz |> each console.log