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
To list all torrents in view 'main' and its tracker url we can chain commands like so: | |
# for testing | |
$ python3 -m rtorrent_xmlrpc scgi://localhost:16891/RPC2 | |
d.multicall2 '' main d.name= d.size_bytes= d.creation_date= t.multicall=,t.url= f.multicall=,f.path= | |
d.multicall2 '' main d.name= d.size_bytes= d.creation_date= d.directory_base= t.multicall=,t.url= |
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
brew update | |
brew install php | |
git clone --depth 1 https://github.com/phacility/libphutil.git | |
git clone --depth 1 https://github.com/phacility/arcanist.git | |
if grep -Fxq 'export PATH=$PATH:$HOME/repos/arcanist/bin' ~/.zshrc | |
then | |
echo 'export PATH=$PATH:$HOME/repos/arcanist/bin' | tee -a ~/.zshrc | |
else | |
echo 'arcanist bin path exists in path, not appending' |
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
#!/bin/sh | |
# | |
# FFmpeg configure script | |
# | |
# Copyright (c) 2000-2002 Fabrice Bellard | |
# Copyright (c) 2005-2008 Diego Biurrun | |
# Copyright (c) 2005-2008 Mans Rullgard | |
# | |
# Prevent locale nonsense from breaking basic text processing. |
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
CREATE OR REPLACE FUNCTION update_table (target_table text, timestamp_col text, | |
from_timestamp timestamp with time zone, constraint_name text, t ANYELEMENT) | |
RETURNS SETOF ANYELEMENT | |
AS $$ | |
DECLARE | |
querytext text; | |
DECLARE | |
tmp text; | |
BEGIN | |
SELECT |
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
create or replace function singapore_postcode_to_district (code text, out district_num int, out district_name text) | |
as $$ | |
begin | |
case substring(code from 1 for 2)::int | |
when 01, 02, 03, 04, 05, 06 then | |
district_num := 1; | |
district_name := 'Raffles Place, Cecil, Marina, People''s Park'; | |
when 07, 08 then | |
district_num := 2; | |
district_name := 'Anson, Tanjong Pagar'; |
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
PUT _ingest/pipeline/extract_timestamp_fromlogfile | |
{ | |
"processors": [ | |
{ | |
"grok": { | |
"field": "message", | |
"patterns": ["%{TIMESTAMP_ISO8601:timestamp}"] | |
} | |
} | |
] |
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
function right() { | |
screencapture -R706,427,1,1 -t bmp /tmp/pixel.bmp | |
echo `xxd -p -l 3 -s 54 /tmp/pixel.bmp` | |
rm /tmp/pixel.bmp | |
} | |
function left() { | |
screencapture -R593,424,1,1 -t bmp /tmp/pixel.bmp | |
echo `xxd -p -l 3 -s 54 /tmp/pixel.bmp` | |
rm /tmp/pixel.bmp |
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
#include <iostream> | |
#include <memory> | |
#include <boost/asio.hpp> | |
#include <boost/bind.hpp> | |
//thanks kalven for tips/debugging | |
using boost::asio::ip::tcp; | |
class Session : public std::enable_shared_from_this<Session> |
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
#!/bin/sh | |
head -1 ~/.ssh/authorized_keys | ssh-keygen -l -f - > /dev/null 2>&1 | |
if [ $? != 0 ]; | |
then | |
echo "invalid public key found in authorized_keys, exiting.." | |
exit | |
fi |
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
/* | |
* stripcmt() | |
* | |
* This is the core of the program. It reads from file 'infile' and outputs | |
* the code (minus comments) to 'outfile'. It does this inefficiently since | |
* it outputs byte by byte instead of in blocks, but I'm too lazy to fix that | |
* right now. Maybe later. | |
*/ | |
void |
NewerOlder