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 | |
sudo apt-get install -yqq dirmngr --install-recommends | |
echo deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main | sudo tee /etc/apt/sources.list.d/ansible.list > /dev/null | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 > /dev/null 2>&1 | |
sudo apt-get update -qq 2> /dev/null | |
sudo apt-get install -yqq ansible tmux |
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 | |
source /etc/os-release | |
if [ "$ID" = "debian" ] || [ "$ID" = "ubuntu" ]; then | |
sudo apt-get install -y linux-headers-$(uname -r) | |
sudo docker run -ti -v /usr/src:/usr/src:ro \ | |
-v /lib/modules/:/lib/modules:ro \ | |
-v /sys/kernel/debug/:/sys/kernel/debug:rw \ |
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 | |
# bcc | |
sudo apt-get update | |
sudo apt-get install -y git cmake bison flex python clang libclang-dev libelf-dev arping iperf3 \ | |
libluajit-5.1-dev zlib1g-dev linux-headers-$(uname -r) | |
sudo apt-get install -y python3-distutils | |
git clone https://github.com/iovisor/bcc.git /tmp/src/bcc | |
mkdir /tmp/src/bcc/build; pushd /tmp/src/bcc/build; |
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
function Get-SQLserverKey { | |
## function to retrieve the license key of a SQL 2012 Server. | |
## by Jakob Bindslet (jakob@bindslet.dk) | |
## 2012 Modification by Xian Wang (daanno2@gmail.com) | |
param ($targets = ".") | |
$hklm = 2147483650 | |
$regPath = "SOFTWARE\Microsoft\Microsoft SQL Server\110\Tools\Setup" | |
$regValue1 = "DigitalProductId" | |
$regValue2 = "PatchLevel" | |
$regValue3 = "Edition" |
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 | |
source /etc/os-release | |
if [ "$ID" = "debian" ] || [ "$ID" = "ubuntu" ]; then | |
sudo apt-get install -y linux-headers-$(uname -r) | |
sudo docker run -it --rm \ | |
--privileged \ | |
-v /lib/modules:/lib/modules:ro \ |
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
use hyper::rt::{self, Future, Stream}; | |
use hyper::Client; | |
use hyper::Body; | |
use hyper; | |
use tokio::runtime::Runtime; | |
use hyper_tls::HttpsConnector; | |
use std::io::{self, Write}; | |
const HN_API_URL_TOPSTORIES: &str = "https://hacker-news.firebaseio.com/v0/topstories.json"; |
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
SELECT MAX(FCT_CODE) KEEP(DENSE_RANK FIRST ORDER BY FNL_UPD_DT desc, PRODC_MAGT_NO desc) AS FCT_CODE, | |
MAX(PLANT_CODE) KEEP(DENSE_RANK FIRST ORDER BY FNL_UPD_DT desc, PRODC_MAGT_NO desc) AS PLANT_CODE, | |
MAX(PRODC_MAGT_NO) KEEP(DENSE_RANK FIRST ORDER BY FNL_UPD_DT desc, PRODC_MAGT_NO desc) AS PRODC_MAGT_NO | |
FROM TBM_PM_PRODC_PRGS A | |
WHERE 1 = 1 | |
AND (A.FCT_CODE, A.PLANT_CODE) IN (('C100A', 'P105')) | |
AND (A.PRODC_MAGT_NO = '0F5PH3AH700007H' OR A.PRODC_MAGT_NO LIKE '0F5PH3AH700007H'||'_') | |
AND ROWNUM = 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
:%s/\('.\{-}'\)\(\s*\)\(::\)\@!/\1::text\2/g |
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
DO $$ | |
DECLARE | |
cur pg_lsn; | |
cur2 pg_lsn; | |
BEGIN | |
cur := pg_current_xlog_location(); | |
loop | |
execute pg_sleep(5); |
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 ( | |
"fmt" | |
"os/exec" | |
"strings" | |
) | |
func runcmd(command string) string { | |
var shell, flag string |