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
Sub ExportSQL() | |
Dim FilePath As String | |
Dim CellData As String | |
Dim LastCol As Long | |
Dim LastRow As Long | |
CellData = "" | |
FilePath = Application.ActiveWorkbook.Path & "\insert.sql" |
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
$gscript = "test-script/startup.ps1";Invoke-Expression $(Invoke-RestMethod -Uri $("https://storage-download.googleapis.com/"+$gscript+"?access_token=" + $($(Invoke-RestMethod -Uri "http://metadata/computeMetadata/v1/instance/service-accounts/default/token" -Headers @{"Metadata-Flavor"="Google"}).access_token))); |
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
# Mounting pgdata disk | |
parted -s /dev/disk/by-id/google-pgdata mktable gpt | |
parted -s /dev/disk/by-id/google-pgdata mkpart primary ext4 0% 100% | |
sleep 5 | |
mkfs.ext4 /dev/disk/by-id/google-pgdata-part1 -L pgdata | |
sleep 2 | |
mkdir $PGDATA_MOUNT | |
echo "/dev/disk/by-id/google-pgdata-part1 $PGDATA_MOUNT ext4 noatime,data=writeback,barrier=0,nobh 0 2" >> /etc/fstab | |
mount -a |
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
while true; do echo $(date +%H:%M:%S) $(awk "BEGIN { printf \"%6.2f%\n\", $(ls | grep -v .gstmp | wc -l)/135530 *100 }") $(df -h --output=avail /dev/sdd2 | awk END{print}) free; sleep 3; done |
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
# iTerm | |
``` | |
tell application "iTerm" | |
set newWindow to (create window with default profile) | |
tell newWindow | |
activate | |
end tell | |
end tell | |
``` |
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 | |
AWS_REGION="--region XXX_REGION" | |
AWS_PROFILE="--profile XXX_PROFILE" | |
LOG_GROUP="XXX_YOUR_LOG_GROUP" | |
LOG_STREAM="$(whoami)-$( date "+%Y%m%d-%H-%M-%S")" | |
aws logs create-log-stream --log-group-name $LOG_GROUP --log-stream-name $LOG_STREAM $AWS_REGION $AWS_PROFILE |
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
// ==UserScript== | |
// @name PHP Manual redirect | |
// @namespace https://github.com/totomz | |
// @version 0.1 | |
// @description Force contents fro php.net/manual to be served in ENG! | |
// @author You | |
// @match http://php.net/manual/* | |
// @grant none | |
// ==/UserScript== |
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
<script> | |
hbspt.forms.create({ | |
portalId: "0000", | |
formId: "aaa-bbbb-cccc", | |
onFormReady: function($form){ | |
var input = $form.find('input[type=email]'); | |
input.addClass('form-control'); | |
input.attr('placeholder','Enter your e-mail address'); |
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
<script> | |
hbspt.forms.create({ | |
portalId: "0000", | |
formId: "aaa-bbb-ccc", | |
onFormReady: function($form){ | |
var input = $form.find('input[type=email]'); | |
input.addClass('form-control'); | |
input.css('width', '100%'); |
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
const WebSocket = require('ws'); | |
const id = '81bf9a17d914'; | |
const url = `ws+unix:///var/run/docker.sock:/containers/${id}/attach/ws?stream=1&stdout=1&logs=1`; | |
const socket = new WebSocket(url, { | |
perMessageDeflate: false | |
}); |
OlderNewer