Skip to content

Instantly share code, notes, and snippets.

View purwandi's full-sized avatar
🏠
Working from home

purwandi purwandi

🏠
Working from home
View GitHub Profile
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 22, 2024 05:53
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@panzi
panzi / 00_head.html
Created November 1, 2012 04:58
Save/download data generated in JavaScript (1)
<!DOCTYPE html>
<html>
<head>
<title>Save Generated Data</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1"/>
<script type="text/javascript">
// <![CDATA[
@mtigas
mtigas / README.md
Last active December 16, 2022 02:12
this is the nginx config for https://mike.tig.as/, with config to avoid the BEAST exploit (by using TLS 1.2+ ciphers or RC4) and enable SSL perfect forward secrecy (by preferring ECDHE ciphers)

[mike.tig.as][mta] server configuration

This gist contains the nginx and tor configurations for the [mike.tig.as][mta] servers, mainly to show:

  • Use of the chris-lea/nginx-devel PPA to allow use of SPDY.
  • ssl_ciphers selection to mitigate BEAST attack, enable [perfect forward secrecy][pfs] if possible and select the strongest possible ciphers within those bounds. (Exception is made for several ciphers at the end of list, for compatibility reasons.)
@dhrrgn
dhrrgn / Db.php
Created December 8, 2012 02:31
The Db file for easy use of the Database package from L4 outside of L4.
<?php
use Illuminate\Database\Connectors\ConnectionFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\ConnectionResolver;
use Illuminate\Database\DatabaseManager;
class Db {
private static $resolver = null;
@KartikTalwar
KartikTalwar / Documentation.md
Last active May 9, 2024 12:59
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@eudes
eudes / nginx.conf
Created February 1, 2013 21:18
Calomel.org /etc/nginx.conf Nginx reverse proxy to a few back end web servers
#######################################################
### Calomel.org /etc/nginx.conf BEGIN
#######################################################
worker_processes 3;
#worker_rlimit_nofile 1024;
events {
worker_connections 64;
#accept_mutex_delay 50ms;
@davidbehan
davidbehan / atmail-exim-commands
Created September 3, 2013 21:14
Some atmail/exim commands for searching and managing the message queue
# start/stop/restart atmail
/etc/init.d/atmailserver start
/etc/init.d/atmailserver stop
/etc/init.d/atmailserver restart
# count of messages in queue
/usr/local/atmail/mailserver/bin/exim -bpc
# list of messages in queue
/usr/local/atmail/mailserver/bin/exim -bp
@dhrrgn
dhrrgn / elasticsearch.yml
Last active January 2, 2016 12:29
ElasticSearch Install
cluster.name: "my-es"
index.number_of_shards: 5
index.number_of_replicas: 1
cloud:
aws:
region: us-east-1
access_key: <key here>
secret_key: <secret here>
@dalu93
dalu93 / Fastfile
Last active October 1, 2021 15:22
Fastfile example
fastlane_version "1.49.0"
default_platform :ios
######################
slack_webhook = 'https://...' #See Slack Incoming Webhook
slack_default_channel = '#channel'
default_production_scheme = 'YOUR-PRODUCTION-SCHEME'
certificates_output_path = './certificates'
profiles_output_path = './profiles'
@visnup
visnup / README.md
Last active September 18, 2017 02:25
RICOH THETA S live 360º video stream rendering in Chrome via WebGL and a <video> texture

To get this working, you'll need the [live-streaming software from RICOH][1]. Install that and follow the [live video instructions][2] to connect your camera to your computer and have it show up as a video source.

If you're on a Mac, you can open up the FaceTime app and test it by picking "THETA UVC Blender" from the Video menu.

Once all of that is working, open up index.html and you should see the video rendered on the inside of a sphere that you can rotate around. Use the mouse to click and drag to move the camera around and the mouse wheel to zoom in and