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
var casper = require('casper').create(); | |
var utils = require('utils'); | |
casper.start(); | |
casper.setHttpAuth(casper.cli.get(1), casper.cli.get(2)); | |
casper.thenOpen('http://' + casper.cli.get(0)).then(function() { | |
this.echo(this.getTitle() + ': Logged in.'); | |
}); |
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/bash | |
SEARCH_STRING="${1}" | |
ROOT_NODE="${2}" | |
FILE="${3}" | |
XPATHS=( $(xml-grep --extended-regexp --attributes "${SEARCH_STRING}" "${FILE}" | xml-fmt | xml-find | sed 's@^/root@/'"${ROOT_NODE}"'@' | tac) ) | |
i_=""; | |
NODE_XPATHS=( $(for i in "${XPATHS[@]}"; do if ! echo "${i_}" | egrep -q "${i}"; then echo "${i}"; fi; i_="${i}"; done) ) | |
for i in "${NODE_XPATHS[@]}"; do | |
k=1; | |
for j in $(xml-printf '%s' "${FILE}" ":${i}"); do |
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/bash | |
pushd ~/".docker" || exit 1; if [[ ! -d "docker-proot-static-build" ]]; then git clone "https://github.com/proot-me/proot-static-build.git" -b build_environment docker-proot-static-build; | |
else ( cd ~/".docker/docker-proot-static-build" && git pull ); fi; popd | |
pushd ~/".docker/docker-proot-static-build" || exit 1; docker build -t proot/proot-buildenv:latest -f Dockerfile.x86_64 . || exit 1; popd | |
if [[ -n "${1}" ]]; then GIT_SHA="${1}"; shift 1; fi | |
if [[ -n "${1}" ]]; then exit 254; fi | |
if [[ -z "${GIT_SHA}" ]]; then |
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/bash | |
### This can be run as: | |
### bash -i -c "source <(curl -L 'https://gist.githubusercontent.com/tsjk/4b387dd685b9942bcc23497fd3345b99/raw')" | |
### This script aims to upgrade your kernel packages, and then install ArchZFS the kernel packages installed. | |
declare -g -i COMPILE_LOCALLY=0 | |
[[ "${1}" != "--compile-locally" ]] || { COMPILE_LOCALLY=1; shift 1; } | |
[[ -z "${*}" ]] || exit 1 |
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
-- File: PowerCycle.lua | |
-- Call with (e.g.): curl -s -X GET 'http://<ip_address>/api/lua/call?script=PowerCycle&function=powerCycle&deviceName=<device_name>&initialDelaySec=<seconds>&delaySec=<seconds>' -H 'Authorization: Bearer <access_token>' | |
-- File: PowerCycle.lua | |
local ON = 1 | |
local OFF = 2 | |
local deviceManager = require "telldus.DeviceManager" | |
local nRetries = 3 | |
local retryDelayMs = 1000 |
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/bash | |
[[ -d "/usr/local/portage/net-irc/irssi-mod-fish" ]] && DH1080_TCL_REPO=$(mktemp -d) && \ | |
( cd /usr/local/portage/net-irc/irssi-mod-fish && sudo ebuild irssi-mod-fish-9999.ebuild clean compile ) && \ | |
( sudo chown -R "$(id -nu)": "/tmp/portage/net-irc/irssi-mod-fish-9999" ) && \ | |
( cd "${DH1080_TCL_REPO}" && git clone "https://github.com/orkim/dh1080_tcl.git" ) && \ | |
( cd "/tmp/portage/net-irc/irssi-mod-fish-9999/work/irssi-mod-fish-9999/src" && \ | |
cp -av "${DH1080_TCL_REPO}/dh1080_tcl"/* ./ && rm -rf "${DH1080_TCL_REPO}" && \ | |
sed -i -E 's@^TCLINC=.*@TCLINC=\/usr\/include@' make_linux* && \ | |
./make_linux64.sh && cp -av DH1080.so DH1080_tcl.so ~/ ) && \ | |
( cd /usr/local/portage/net-irc/irssi-mod-fish && sudo ebuild irssi-mod-fish-9999.ebuild clean ) && \ |
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 | |
# Copyright (C) 2006 OpenWrt.org | |
# Copyright (C) 2010 Vertical Communications | |
# To be included in ROM image, together with at least usb-modeswitch, | |
# kmod-usb-storage and a /etc/usb-mode.preinit.json. | |
# | |
# Tested on OpenWRT v19.07.3 | |
log_usbmode() { |
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
# Usage: ( VERSION="19.07.9" && ARCH="ar71xx" && TYPE="tiny" && cd "${OPENWRT_BUILD_DIR}" && \ | |
# wget -O './.config' "https://downloads.openwrt.org/releases/${VERSION}/targets/${ARCH}/${TYPE}/config.buildinfo" && \ | |
# cat "${THIS_FILE}" >> ./.config && make defconfig ) | |
CONFIG_TARGET_ar71xx=y | |
CONFIG_TARGET_ar71xx_tiny=y | |
CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3420-v2=y | |
CONFIG_ALL_KMODS=y | |
CONFIG_ALL_NONSHARED=y | |
CONFIG_DEVEL=y | |
CONFIG_AUTOREMOVE=y |
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/bash | |
BASENAME=$(basename "${0}"); DIRNAME=$(dirname "${0}"); DIRNAME=$(realpath "${DIRNAME}"); | |
VERSION=$(grep -oP '(?<=imgbuilder-)[0-9\.]+(?=-)' <<< "${BASENAME}") | |
ARCH=$(sed -E 's@^imgbuilder-[0-9\.]+-@@' <<< "${BASENAME}" | grep -oP '^[^-]+') | |
TYPE=$(sed -E 's@^imgbuilder-[0-9\.]+-@@; s@'"${ARCH}"'-@@' <<< "${BASENAME}" | grep -oP '^[^\.]+') | |
[[ -n "${VERSION}" && -n "${ARCH}" && -n "${TYPE}" ]] || exit 255 | |
[[ ! -x "${DIRNAME}/imgbuilder-get-base-path.sh" ]] || source "${DIRNAME}/imgbuilder-get-base-path.sh" | |
[[ -n "${OPENWRT_IMG_BUILDER_BASE_PATH}" ]] || OPENWRT_IMG_BUILDER_BASE_PATH="${DIRNAME}/openwrt-imagebuilder-${ARCH}-${TYPE}" |
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/bash | |
# Usage: sdparm-disable_sleep.sh <device> | |
[[ -n "${1}" && -b "${1}" ]] \ | |
&& sdparm --flexible --page=po -l -a "${1}" \ | |
&& { sdparm --set=STANDBY_Z=0 -S "${1}" \ | |
&& sdparm --set=SZCT=$((45*60*100)) -S "${1}" \ | |
&& sdparm --flexible --page=po -l -a "${1}"; } |
OlderNewer