-
Check if Ubuntu Linux Kernel version is 4.9
$ uname -r
-
If not, follow the link http://www.yourownlinux.com/2016/12/how-to-install-linux-kernel-4-9-0-in-linux.html instructions to update your Ubuntu Linux Kernel to 4.9
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 | |
# | |
# beanstalkd - a simple, fast workqueue service | |
# | |
# chkconfig: - 57 47 | |
# description: a simple, fast workqueue service | |
# processname: beanstalkd | |
# config: /etc/sysconfig/beanstalkd | |
# |
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 | |
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/ | |
# | |
ARGS=2 | |
E_BADARGS=99 | |
if [ $# -ne $ARGS ] # correct number of arguments to the script; | |
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
''' | |
This script will attempt to open your webbrowser, | |
perform OAuth 2 authentication and print your access token. | |
It depends on two libraries: oauth2client and gflags. | |
To install dependencies from PyPI: | |
$ pip install python-gflags oauth2client |
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
[root@centos mysql]# nc -vz localhost 3306 | |
nc: connect to localhost port 3306 (tcp) failed: Connection refused | |
Connection to localhost 3306 port [tcp/mysql] succeeded! | |
The reason is the first connection is against ::1 (IPv6), and the second to 127.0.0.1. | |
This could be seen with: tcpdump -i lo -n | |
[root@centos mysql]# grep localhost /etc/hosts |
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 ( | |
"bytes" | |
"compress/gzip" | |
"database/sql/driver" | |
"errors" | |
"fmt" | |
"github.com/jmoiron/sqlx" | |
_ "github.com/mattn/go-sqlite3" |
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
-- Related blog post to this Gist: | |
-- https://torsten.io/stdout/expanding-json-arrays-to-rows | |
-- Run these commands on a interactive RedShift session: | |
CREATE TEMP TABLE clusters AS ( | |
SELECT 1 AS id, '[1, 2]' AS node_sizes UNION ALL | |
SELECT 2 AS id, '[5, 1, 3]' AS node_sizes UNION ALL | |
SELECT 3 AS id, '[2]' AS node_sizes | |
); |
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
# install openjdk | |
sudo apt-get install openjdk-7-jdk | |
# download android sdk | |
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz | |
tar -xvf android-sdk_r24.2-linux.tgz | |
cd android-sdk-linux/tools | |
# install all sdk packages |
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
curl --include \ | |
--no-buffer \ | |
--header "Connection: Upgrade" \ | |
--header "Upgrade: websocket" \ | |
--header "Host: example.com:80" \ | |
--header "Origin: http://example.com:80" \ | |
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \ | |
--header "Sec-WebSocket-Version: 13" \ | |
http://example.com:80/ |
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
#!/usr/bin/env python | |
# Includes | |
import getopt | |
import sys | |
import os.path | |
import subprocess | |
import BaseHTTPServer | |
import SocketServer | |
import time |
OlderNewer