Skip to content

Instantly share code, notes, and snippets.

View jachermocilla's full-sized avatar

Joseph Anthony C. Hermocilla jachermocilla

View GitHub Profile
/**
* A Java implementation of Topological Sorting
*
* @author JAC Hermocilla ([email protected])
*
*/
import java.util.*;
/*
@jachermocilla
jachermocilla / elbifiles.py
Last active August 29, 2015 14:07
Retrieve posts from "Elbi Files" using Python
"""
based on : <https://gist.github.com/mylsb/10294040>
"""
import facebook
import requests
def some_action(post):
print post['message']
print "----------------------------------------------------"
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>http.agent.name</name>
<value>InsyWinsy</value>
</property>
<property>
#!/bin/bash
#by [email protected]
#
# This script recrawls the sites indicated in URLS_DIR and
# forwards results to Solr.
# This script deletes everyting in Nutch and Solr.
#
JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
NUTCH_HOME=/home/ubuntu/apache-nutch-1.11
#!/bin/bash
#[email protected]
#run as root in BACKUP_DB_PATH
MYSQL_USER=root
MYSQL_PASSWORD=joseph
MYSQL_HOST=127.0.0.1
MYSQL_DATA_PATH=/var/lib/mysql
TARGET_PORT=9999
THIS_USER=root
@jachermocilla
jachermocilla / prodcon.c
Last active January 5, 2023 17:42
Producer-Consumer Problem Solutions (compile with -lpthread)
#define _GNU_SOURCE //to be able to use pthread_setname_np()
//implementation of solution to prod-con from chapter 3, dino book
//not all slots are used
//-jach
//
#include <stdio.h>
#include <pthread.h>
@jachermocilla
jachermocilla / binding.c
Last active April 22, 2018 12:20
Address binding
/**
* [email protected]
*
* $ gcc -fno-common -c -o binding.o binding.c
* $ gcc -fno-commin -o binding.exe binding.c
*
*/
#include <stdio.h>
#include <stdlib.h>
/*
* setuid example by [email protected]
*
* $gcc -o mysuid.exe mysuid.c
* $sudo chown root.root mysuid.exe
* $sudo chmod 4755 mysuid.exe
*
* Note: must be run in a filesystem mounted with no 'nosuid'
* ex: /tmp
*
@jachermocilla
jachermocilla / rsa.c
Last active September 30, 2018 10:30
RSA
/*
An answer to Task3 by [email protected]
rsa.c
$gcc -o rsa.exe rsa.c -lcrypto
*http://www.cis.syr.edu/~wedu/seed/Labs_16.04/Crypto/Crypto_RSA/Crypto_RSA.pdf
*https://goo.gl/HuwEPn
*/
/*
* This is an emailer appscript in google sheets to email students
* Sheet requirements:
* 1. First row should be headers (e.g. EXAM1, QUIZ, etc.)
* 2. Second row should be the total (e.g. 80, 100, etc.)
*/
//-------- Change the values of the variables below to customize --------
//The course