Skip to content

Instantly share code, notes, and snippets.

(venv) ➜ twarc git:(master) ✗ pyinstaller --clean --hidden-import urllib3 --hidden-import queue --onefile twarc.py
(venv) ➜ twarc git:(master) ✗ ls -lah dist/twarc
-rwxr-xr-x 1 raffaele 5.4M Jan 4 21:01 dist/twarc
(venv) ➜ twarc git:(master) ✗ file dist/twarc
dist/twarc: Mach-O 64-bit executable x86_64
./dist/twarc --help
usage: twarc [-h] [--log LOG] [--consumer_key CONSUMER_KEY]
package EPrints::Plugin::Export::DEPOSITOLEGALE;
# eprint needs magic documents field
# documents needs magic files field
use EPrints::Plugin::Export::XMLFile;
@ISA = ( "EPrints::Plugin::Export::DIDL" );
@atomotic
atomotic / .zshrc
Last active February 21, 2018 10:45
check if Software Heritage archive contains your code
function swh-check() { curl -s --data "q=$(sha1sum $* | cut -d " " -f 1)" https://archive.softwareheritage.org/api/1/content/known/search/ | jq . }
~ mediawiki=$(curl -s https://raw.githubusercontent.com/wikimedia/mediawiki/master/index.php | gsha1sum | cut -d " " -f 1)

~ curl -s --data "q=$mediawiki" https://archive.softwareheritage.org/api/1/search/ | jq .
{
  "search_stats": {
    "nbfiles": 1,
    "pct": 100

},

➜ Downloads unzip -l extension_0_0_129.crx
Archive: extension_0_0_129.crx
warning [extension_0_0_129.crx]: 566 extra bytes at beginning or within zipfile
(attempting to process anyway)
Length Date Time Name
-------- ---- ---- ----
0 05-13-16 22:41 icons/
7952 05-13-16 22:41 icons/icon128.png
759 05-13-16 22:41 icons/icon16.png
2858 05-13-16 22:41 icons/icon48.png
@atomotic
atomotic / wget-lua.sh
Created May 3, 2016 09:28
install wget-lua on osx
brew install lua5.1
curl http://warriorhq.archiveteam.org/downloads/wget-lua/wget-1.14.lua.LATEST.tar.bz2 | tar -xj --strip-components=1
sed -i -e s=usr/include/lua5.1=usr/local/include/lua5.1=g configure.ac
./configure
make
cp src/wget /usr/local/bin/wget-lua
wget-lua --help|grep lua
GNU Wget 1.14.lua.20130523-9a5c, a non-interactive network retriever.
Usage: wget-lua [OPTION]... [URL]...
@atomotic
atomotic / # scantailor - 2015-12-04_21-22-47.txt
Created December 4, 2015 20:26
scantailor (homebrew/x11/scantailor) on OS X 10.11.1 - Homebrew build logs
Homebrew build logs for homebrew/x11/scantailor on OS X 10.11.1
Build date: 2015-12-04 21:22:47

conf.ttl

    conf:publicUrlPrefix <http://mylodview/id/>; 

nginx

    location /id {
            proxy_pass http://127.0.0.1:8080/lodview;
            proxy_set_header  X-Real-IP $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header Host $http_host;

@atomotic
atomotic / gist:17d9c43fd0db820dd95e
Last active November 4, 2015 10:19
phantomjs-warcprox
$ pip install warcprox
$ brew install phantomjs
$ warcprox -c warcprox.pem
$ phantomjs --proxy=localhost:8000 \
--ssl-certificates-path=warcprox.pem \
/usr/local/Cellar/phantomjs/2.0.0/share/phantomjs/examples/rasterize.js \
http://{URL} screenshot.png "1024px*768px"
@atomotic
atomotic / warc-formats.go
Last active August 29, 2015 14:26
warc-formats
package main
import (
"bufio"
"bytes"
"fmt"
"github.com/richardlehane/siegfried"
"github.com/slyrz/warc"
"io/ioutil"
"log"