Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| # To install the Python client library: | |
| # pip install -U selenium | |
| # Import the Selenium 2 namespace (aka "webdriver") | |
| from selenium import webdriver | |
| # iPhone | |
| driver = webdriver.Remote(browser_name="iphone", command_executor='http://172.24.101.36:3001/hub') | |
| # Android |
| private static byte[] intToLittleEndian(long numero) { | |
| ByteBuffer bb = ByteBuffer.allocate(4); | |
| bb.order(ByteOrder.LITTLE_ENDIAN); | |
| bb.putInt((int) numero); | |
| return bb.array(); | |
| } | |
| // OR ... | |
| private static byte[] intToLittleEndian(long numero) { |
| /* Exercise: Loops and Functions #43 */ | |
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| ) | |
| func Sqrt(x float64) float64 { | |
| z := float64(2.) |
| #!/usr/bin/env python | |
| """Simple HTTP Server With Upload. | |
| This module builds on BaseHTTPServer by implementing the standard GET | |
| and HEAD requests in a fairly straightforward manner. | |
| """ |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| #!/bin/sh | |
| # Called by "git push" after it has checked the remote status, | |
| # but before anything has been pushed. | |
| # | |
| # If this script exits with a non-zero status nothing will be pushed. | |
| # | |
| # Steps to install, from the root directory of your repo... | |
| # 1. Copy the file into your repo at `.git/hooks/pre-push` | |
| # 2. Set executable permissions, run `chmod +x .git/hooks/pre-push` |
| // httpget.js: download a file (Windows Script Host) | |
| // usage: cscript httpget.js <url> <file> | |
| (function() { | |
| if (WScript.Arguments.Length != 2) { | |
| WScript.Echo("Usage: httpget.js <url> <file>") | |
| WScript.Quit(1) | |
| } | |
| var url = WScript.Arguments(0) |
| from subprocess import Popen, PIPE | |
| import pty | |
| import os | |
| from select import select | |
| import sys | |
| import tty | |
| master, slave = pty.openpty() | |
| p = Popen(['python'], stdin=slave, stdout=PIPE, stderr=PIPE) | |
| pin = os.fdopen(master, 'w') |
| // to compile (using mingw-w64) | |
| // g++ this_filename.c -lole32 | |
| // outputs current system volume (out of 0-100) to stdout, ex: output "23" | |
| // mostly gleaned from examples here: http://msdn.microsoft.com/en-us/library/windows/desktop/dd370839(v=vs.85).aspx | |
| // download a compiled version here: | |
| // https://sourceforge.net/projects/mplayer-edl/files/adjust_get_current_system_volume_vista_plus.exe.exe (updated, can set it too now!) | |
| #include <windows.h> | |
| #include <commctrl.h> | |
| #include <mmdeviceapi.h> | |
| #include <endpointvolume.h> |
| #!/bin/bash | |
| # This script will install a Git pre-push hook that prevents force pushing the master/main branch. | |
| # There are three variants that I have built: | |
| # - pre-push: prevents force-pushing to master/main. | |
| # - pre-push-2: prevents force-pushing to master/main depending on the remote (you need to edit the file!). | |
| # - pre-push-3: prevents any type of pushing to master/main. | |
| # Set the desired version like this before proceeding: | |
| # FILE=pre-push | |
| # Single repo installation: |