This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pabs@halcyon:~/git/fys> perl perl.pl | |
host,time | |
blargh.org,"60d 3h" | |
blum.net,"40d 3h" | |
baz.biz,"32d 3h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
module Recall | |
class Search | |
def initialize(path) | |
# load data | |
@data = File.readlines(path) | |
end | |
def search(q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"RECORD_ID"=>"98200", | |
"CAMPNO"=>"13V454000", | |
"MAKETXT"=>"BMW", | |
"MODELTXT"=>"320I", | |
"YEARTXT"=>"2014", | |
"MFGCAMPNO"=>"", | |
"COMPNAME"=>"SERVICE BRAKES, HYDRAULIC:POWER ASSIST:VACUUM", | |
"MFGNAME"=>"BMW of North America, LLC", | |
"BGMAN"=>"20120501", | |
"ENDMAN"=>"20130831", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"RECORD_ID"=>"98200", | |
"CAMPNO"=>"13V454000", | |
"MAKETXT"=>"BMW", | |
"MODELTXT"=>"320I", | |
"YEARTXT"=>"2014", | |
"MFGCAMPNO"=>"", | |
"COMPNAME"=>"SERVICE BRAKES, HYDRAULIC:POWER ASSIST:VACUUM", | |
"MFGNAME"=>"BMW of North America, LLC", | |
"BGMAN"=>"20120501", | |
"ENDMAN"=>"20130831", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pabs@web:/data1/www> less /etc/apache2/sites-available/tinyapps.pablotron.org | |
<VirtualHost *> | |
ServerName tinyapps.pablotron.org | |
ServerAlias tinyapps-static.pablotron.org | |
ServerAdmin tinyapps-admin@pablotron.org | |
DocumentRoot /data1/www/tinyapps.pablotron.org/public | |
Use BASIC_LOGS tinyapps.pablotron.org | |
Use MOD_DEFLATE | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT a.month, | |
product_id, | |
COUNT(*) AS num_tickets | |
FROM ( | |
SELECT to_char(create_date, 'Mon') AS month, | |
product_id | |
FROM tickets | |
) a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try { | |
# check for choice_id | |
if (!isset($_POST['choice_id'])) | |
throw new Exception('missing choice_id'); | |
# extract choice from request | |
$choice_id = $_POST['choice_id']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def splat(*args, **kwargs): | |
return (kwargs['delim']).join(args) | |
def out(fn, *args, **kwargs): | |
print(fn(*args, **kwargs)) | |
out(splat, 'foo', 'bar', delim=','); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install dependency | |
pabs@meh:~/git/test/rotp> sudo gem install rotp | |
# generate new secret and QR code URL | |
pabs@meh:~/git/test/rotp> ruby ./rotp-example.rb new asdf@example.com | |
QR Code URL: https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth%3A%2F%2Ftotp%2FAlonzo%27s%2520Totally%2520Secure%2520App%3Aasdf%40example.com%3Fsecret%3Dr7eslax2okb2dkr4%26issuer%3DAlonzo%2527s%2BTotally%2BSecure%2BApp | |
Secret: r7eslax2okb2dkr4 | |
Provisioning URL: otpauth://totp/Alonzo's%20Totally%20Secure%20App:asdf@example.com?secret=r7eslax2okb2dkr4&issuer=Alonzo%27s+Totally+Secure+App | |
# at this point i used the QR Code URL above to configure Google Authenticator on my phone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CFLAGS=-W -Wall -O2 -pedantic $(shell sdl2-config --cflags) | |
LIBS=-lm $(shell sdl2-config --libs) | |
OBJS=sdl-click.o | |
APP=sdl-click | |
.PHONY=all clean | |
all: $(APP) | |
$(APP): $(OBJS) |
OlderNewer