This file contains hidden or 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
from selenium import webdriver | |
from time import sleep | |
from selenium.webdriver.chrome.options import Options | |
url = 'https://online.flippingbook.com/view/315002/2/' | |
chrome_options = Options() | |
chrome_options.add_argument('--headless') | |
chrome_options.add_argument('--start-maximized') | |
chrome_options.add_argument("--window-size=4000,2040") |
This file contains hidden or 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 expect -f | |
# Start the CISCO VPN client on a Mac. Adapted from | |
# https://blog.felipe-alfaro.com/2014/05/23/automating-cisco-anyconnect-secure-mobility-client-on-mac-os-x/ | |
set HOSTNAME vpn.server.com | |
set USER_NAME user.name | |
set PASSWORD password | |
spawn /opt/cisco/anyconnect/bin/vpn |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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 | |
echo "DELETE FROM moz_places WHERE rev_host LIKE '%elgoog%' AND url NOT LIKE 'http://google.com/' AND visit_count < 3;" | sqlite3 /Users/mfr/Library/Application\ Support/Firefox/Profiles/ghjefy2u.default/places.sqlite | |
for f in ~/Library/Application\ Support/Firefox/Profiles/*/*.sqlite; do echo "VACUUM;" | sqlite3 "$f" ; done | |
#for f in ~/Library/Application\ Support/Firefox/Profiles/*/*.sqlite; do echo $f; done |
This file contains hidden or 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
/* Personnummer- och ålderkontroll V1.0 | |
(C)David Lidström 2002 | |
för Pellesoft.nu | |
Skapad: 2002-03-28 | |
Senast ändrad: 2002-03-28*/ | |
function PNR_IsValid(vVad) { | |
if( vVad.search(/\d\d\d\d-\d\d-\d\d-\d\d\d\d/) == 0 ) { | |
var d = new Date(); | |
var vYear = parseInt(vVad.substr(0,4)); | |
var vMonth = parseInt(vVad.substr(5,2)); |
This file contains hidden or 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
var page = require('webpage').create(); | |
var system = require('system'); | |
var cur_date = new Date(); | |
var folder = cur_date.getFullYear() + '-' + (cur_date.getMonth()+1) + '-' + cur_date.getDate();// +'_'+ cur_date.getHours() +cur_date.getMinutes(); | |
var url = system.args[1]; | |
var filename = url.replace(/[^a-z0-9]/gi, '_').toLowerCase(); | |
page.open(url, function () { | |
page.render(folder+'/'+filename+'.png'); |
This file contains hidden or 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
var page = require('webpage').create(), | |
address, output, size; | |
if (phantom.args.length < 2 || phantom.args.length > 3) { | |
console.log('Usage: rasterize.js URL filename'); | |
phantom.exit(); | |
} else { | |
address = phantom.args[0]; | |
output = phantom.args[1]; | |
page.viewportSize = { width: 1280, height: 1024 }; |
This file contains hidden or 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
export PATH=/usr/local/bin:/usr/local/sbin:$PATH | |
[ -z "$PS1" ] && return | |
export TERM=xterm-color | |
export CLICOLOR=1 | |
export LSCOLORS=GxFxCxDxBxegedabagaced | |
#export PS1="\h:\W \u\$" | |
#export PS1="[\u@\[\e[32;1m\]\H \[\e[0m\]\w]\$ " | |
#export PS1="\h:\[\e[32;1m\]\W\e[0m\] \$ " | |
#alias ll='ls -hl' |
This file contains hidden or 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/bash | |
# Script that checks whether lighttpd is still up, and if not: | |
# - e-mail the last bit of log files | |
# - kick some life back into it | |
# -- Thomas, 20050606 | |
PATH=/bin:/usr/bin | |
THEDIR=/tmp/lighttpd-watchdog | |
EMAIL= | |
PATH= |
This file contains hidden or 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/bash | |
for f in *.css; do | |
grep -ioE "(url\(|src=)['\"]?[^)'\"]*" $f | grep -ioE "[^\"'(]*.\.(woff)" | while read l ; do | |
sed -i "s>$l>data:font/${l/[^.]*./};base64,`openssl enc -base64 -in $l| tr -d '\n'`>" $f ; | |
done; | |
done; |
NewerOlder