Skip to content

Instantly share code, notes, and snippets.

Avatar

Assil Ksiksi aksiksi

View GitHub Profile
@aksiksi
aksiksi / _rpi-htpc.md
Last active Aug 4, 2019
A docker-compose config that spins up a simple HTPC setup on a Raspberry Pi.
View _rpi-htpc.md

To enable the service: sudo systemctl enable rpi-htpc

To start the service: sudo systemctl start rpi-htpc

Make sure all ports specified in the docker-compose YAML config are available.

Once everything is up, you can configure/restore NZBGet, Sonarr, and Radarr to your liking.

@aksiksi
aksiksi / subset_sum.py
Created Nov 20, 2017
A solution to the subset sum problem using a branch-and-bound approach.
View subset_sum.py
"""
Problem:
Given a vector of ints/floats V, find the number of length 3 subsets which have a sum < X.
Assume that V contains no duplicates.
"""
def num_subsets(V, X, N):
global count
count = 0
@aksiksi
aksiksi / aesgcm.go
Last active Oct 22, 2017
Encrypt and decrypt a plaintext with AES-GCM in Go. Plaintext is passed in as command line argument.
View aesgcm.go
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"os"
)
@aksiksi
aksiksi / keybase.md
Created Aug 29, 2017
Keybase proof.
View keybase.md

Keybase proof

I hereby claim:

  • I am aksiksi on github.
  • I am aksiksi (https://keybase.io/aksiksi) on keybase.
  • I have a public key ASC5Xk7XO42Q_4mUVJ7PjgnZzGzQHhCSACBaOG3JwmfR4Ao

To claim this, I am signing this object:

@aksiksi
aksiksi / ping-do.py
Last active Mar 30, 2016
Simple script to test DigitalOcean's datacenters speed
View ping-do.py
#!/usr/bin/env python
import subprocess
class SpeedTest(object):
datacenters = [
{
'name': 'NYC1',
'host': 'speedtest-nyc1.digitalocean.com',
'ip': '198.211.112.36',
'location': 'New York, USA',
@aksiksi
aksiksi / hello.pas
Created Mar 20, 2016
Some Free Pascal...
View hello.pas
program Hello;
uses sysutils;
// Record syntax
type Book = record
title: string;
author: string;
isbn: string;
end;
@aksiksi
aksiksi / spectre_vector_stimulus.py
Created Mar 15, 2016
Generates a Spectre input stimulus file for n vectors. Run with --help for details and an example.
View spectre_vector_stimulus.py
#!/usr/bin/python
'''
Outputs a Cadence ADE stimulus file for n input vectors.
Supports Python 2.x only. I created this for use on a RHEL
box running Cadence.
Global variables
SOURCE: the source type generated for each bit of the vectors.
View timing-optimization.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aksiksi
aksiksi / imdbtop250-scrape.py
Created Jul 7, 2012
Scrapes IMDB Top 250 list and writes data to a database.
View imdbtop250-scrape.py
#################################################################
## Written by: Assil Ksiksi ##
## ## ## ##
## Scrapes IMDB for movie IDs, makes API requests, then writes ##
## the results to a database. ##
## ## ## ##
#################################################################
import re, requests, sqlite3, json, time
@aksiksi
aksiksi / newton-method.py
Created Apr 12, 2012
Newton's Method in Python
View newton-method.py
# Finds a root of a number using Newton's method. Outputs the first 5 approximations.
def newton(n, x):
x1 = x - (x*x-n)/(2*x*x)
return x1
root = float(raw_input("Enter a number to approximate the square root of: "))
approx = float(raw_input("Enter approximation for root: "))
print ''
You can’t perform that action at this time.