Skip to content

Instantly share code, notes, and snippets.

View davidphasson's full-sized avatar

David Hasson davidphasson

  • Los Angeles, CA
View GitHub Profile
#!/usr/local/bin/bash
# Declare an array
declare -a locations
# Populate with locations
locations=( four_d enigma hardi adni woods edevel ccb ad altshuler asl collabs fmri shapetls spectrum mouse ois gsrs blackops eluders warp bearden poldrack )
# Set a date string for the snapshot names
date=`date +%y-%m-%d_%H-%M-%S`
#include <stdio.h>
#include <math.h>
void avg_pbr(int a, int b, int *r);
int avg(int b, int a);
int main()
{
int *result;
#!/usr/bin/env python
import os, sys, httplib, base64, pprint
pp = pprint.PrettyPrinter(indent=4)
headers = {
# "x-isi-set-location": sys.argv[2],
}
conn = httplib.HTTPConnection("www.loni.ucla.edu", 80)
<?php
$target = "files/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded ";
$secs = time() - $_SERVER['REQUEST_TIME'];
echo "in a total of $secs seconds.";
}
@0 anchor "default" all
[ Evaluations: 2873 Packets: 4748 Bytes: 1002207 States: 29 ]
[ Inserted: uid 0 pid 15535 State Creations: 276 ]
@1 block drop in quick from urpf-failed to any
[ Evaluations: 2873 Packets: 351 Bytes: 82795 States: 0 ]
[ Inserted: uid 0 pid 15535 State Creations: 0 ]
@2 pass out quick on vr0 proto udp from any port = bootpc to any port = bootps keep state
[ Evaluations: 2522 Packets: 0 Bytes: 0 States: 0 ]
[ Inserted: uid 0 pid 15535 State Creations: 0 ]
@3 block drop in log quick on vr0 inet proto udp from any port = bootps to 192.168.254.0/24 port = bootpc
<?xml version="1.0"?>
<nswall>
<version>1.6</version>
<lastchange>1253659242</lastchange>
<system>
<username>admin</username>
<password>$1$PzndnKjk$gaW3dSJjbVQHQftwBbwRh.</password>
<general>
<timeservers>pool.ntp.org</timeservers>
<time-update-interval>300</time-update-interval>
lo0: flags=8049 mtu 33200
priority: 0
groups: lo
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6
vr0: flags=8843 mtu 1500
lladdr 00:0d:b9:18:8e:ec
priority: 0
groups: egress
<?php
$fp = fopen('php://stdin', 'r');
echo "\nEnter the URL for the image file you want to flash [enter for default]:";
$url = chop(fgets($fp));
if(! $url)
{
@davidphasson
davidphasson / crontab
Created May 28, 2009 23:05
OpenBSD based router configs
* 1 * * * /bin/mfs-sync
@davidphasson
davidphasson / db_backup.rb
Created April 29, 2009 23:27 — forked from bensie/db_backup.rb
Amazon S3 Backup Example
mysql_username = "backup"
mysql_password = ""
databases = [ 'db1', 'sb2' ]
temp_directory = "/mnt/storage/backups"
s3_access_key_id = 'xxxx'
s3_secret_access_key = 'xxxx'
s3_bucket_name = 'database-bucket'
require 'rubygems'
require 'aws/s3'