Skip to content

Instantly share code, notes, and snippets.

@anmsid
anmsid / spssjavaplugin_maven.txt
Created January 15, 2019 08:12
How to include IBM spssjavaplugin.jar into local maven repository on Mac
# Install the jar
mvn install:install-file -Dfile=/Applications/IBMSPSSStatistics/Subscription/SPSSStatisticsSubscription.app/Contents/bin/spssjavaplugin.jar -DgroupId=com.ibm.statistics -DartifactId=spssjavaplugin -Dversion=1.0 -Dpackaging=jar
# Include the package in pom.xml
<dependency>
<groupId>com.ibm.statistics</groupId>
<artifactId>spssjavaplugin</artifactId>
<version>1.0</version>
</dependency>
@anmsid
anmsid / prepare_tomato_backend.sh
Created July 20, 2015 09:37
prepare tomato-backend and geni-lib on CloudLab
#!/bin/sh
# prepare tomato-backend and geni-lib on CloudLab
# activate extra disk space and mount it under /tomato
sudo /usr/local/etc/emulab/mkextrafs.pl -r /dev/sda /tomato
sudo mkdir /tomato/{files,templates}
sudo chown tomato:tomato /tomato/{files,templates}
sudo service tomato-backend stop
cd /var/lib/tomato
@anmsid
anmsid / pwphotos.py
Last active August 29, 2015 14:21
Simple script utilizing google gdata photo service, for those who are lazy enough to create a WordPress content and just want to dump everything from their Picasaweb album.
#!/usr/bin/env python
import gdata.photos.service
import argparse
"""
For those who are lazy enough to create a wordpress content and just want to dump everything from their Picasaweb album.
Usage: ./pwphotos.py -u PICASAWEB_USER -a PICASAWEB_ALBUM
Output will be printed to stdout, you can simply redirect it to a file > out.txt or just copy paste to WordPress (Text mode)
"""
gd_client = gdata.photos.service.PhotosService()
@anmsid
anmsid / node_nginx_proxy.conf
Created May 31, 2014 13:44
NodeJS + Socket.IO app served through Nginx proxy
# Node JS app backend
upstream node_server {
server 127.0.0.1:3003;
}
server {
server_name app.example.com;
#forward to NodeJS app
location / {
proxy_pass http://node_server;
@anmsid
anmsid / cloudflare_realip.conf
Created March 13, 2014 14:26
Nginx configuration to detect real ip of requests originating from cloudflare servers
# CloudFlare IP Ranges
# Generated at Sat Oct 5 13:51:31 UTC 2013 by ./cloudflare_ips.sh
set_real_ip_from 204.93.240.0/24;
set_real_ip_from 204.93.177.0/24;
set_real_ip_from 199.27.128.0/21;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
@anmsid
anmsid / googe_realip.conf
Created March 13, 2014 14:24
Nginx configuration to detect real ip of requests originating from google pagespeed service servers
# Google IPs IPv4
set_real_ip_from 216.239.32.0/19;
set_real_ip_from 64.233.160.0/19;
set_real_ip_from 66.249.80.0/20;
set_real_ip_from 72.14.192.0/18;
set_real_ip_from 209.85.128.0/17;
set_real_ip_from 66.102.0.0/20;
set_real_ip_from 74.125.0.0/16;
set_real_ip_from 64.18.0.0/20;
set_real_ip_from 207.126.144.0/20;
@anmsid
anmsid / scrap48.py
Created December 23, 2013 23:48
Scrape member profile details from jkt48.com website and store it into json format.
#!/usr/bin/env python
import urllib2
import re
import json
"""
Scrape member profile details from jkt48.com website and store it into json format.
Author: anmsid[at]gmail.com
"""
@anmsid
anmsid / feedly2opml.py
Created December 20, 2013 16:17
A simple script to convert feedly.cache (json) file to opml that can be imported back to feedly.
#!/usr/bin/env python
"""
A simple script to convert feedly.cache (json) file to opml.
Usage: python feedly2opml.py feedly.cache
It will print the opml to stdout. Use redirection to save into file:
python feedly2opml.py feedly.cache > feedly.opml
Author: anmsid[at]gmail.com
"""