type Vertex struct {
Lat, Long float64
}
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
# $Id: screen-keys.conf,v 1.7 2010-07-31 11:39:13 nicm Exp $ | |
# | |
# By Nicholas Marriott. Public domain. | |
# | |
# This configuration file binds many of the common GNU screen key bindings to | |
# appropriate tmux key bindings. Note that for some key bindings there is no | |
# tmux analogue and also that this set omits binding some commands available in | |
# tmux but not in screen. | |
# | |
# Note this is only a selection of key bindings and they are in addition to the |
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
func readLine(path string) { | |
inFile, _ := os.Open(path) | |
defer inFile.Close() | |
scanner := bufio.NewScanner(inFile) | |
scanner.Split(bufio.ScanLines) | |
for scanner.Scan() { | |
fmt.Println(scanner.Text()) | |
} | |
} |
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 | |
# Originally from: | |
# https://github.com/blankpage/e5UNIXBuilder/blob/master/build-akili.sh | |
# Linux and similar... | |
CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null` | |
# FreeBSD and similar... | |
[ -z "$CPUS" ] && CPUS=`getconf NPROCESSORS_ONLN` | |
# Solaris and similar... | |
[ -z "$CPUS" ] && CPUS=`ksh93 -c 'getconf NPROCESSORS_ONLN'` |
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 | |
unshared () { | |
grep '^[0-9]\+$' "$1" > /dev/null | |
} | |
for cpu in $(ls -d /sys/devices/system/cpu/cpu[0-9]* | sort -t u -k 3 -n); do | |
echo "${cpu##*/}: [Package #$(cat $cpu/topology/physical_package_id), Core #$(cat $cpu/topology/core_id)]" | |
if ! unshared $cpu/topology/core_siblings_list; then | |
echo " same package as $(cat $cpu/topology/core_siblings_list)" |
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
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works | |
package main | |
import ( | |
"fmt" | |
"golang.org/x/crypto/ssh" | |
) | |
const privateKey = `content of id_rsa` |
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
package main | |
import ( | |
"database/sql" | |
"fmt" | |
_ "github.com/denisenkom/go-mssqldb" | |
) | |
func main() { | |
DB, err := sql.Open("mssql", "server=172.16.32.1**;port=1433;user id=sa;password=*****;database=demo;") |
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 | |
apt-get -y update | |
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev | |
wget -c https://openresty.org/download/openresty-1.9.15.1.tar.gz | |
tar zxvf openresty-1.9.15.1.tar.gz | |
cd openresty-1.9.15.1 | |
./configure \ | |
--sbin-path=/usr/sbin/nginx \ | |
--conf-path=/etc/nginx/nginx.conf \ |
OlderNewer