Skip to content

Instantly share code, notes, and snippets.

@nginx-gists
nginx-gists / ubuntu_install.sh
Last active February 8, 2024 13:21
Automating Installation of WordPress with NGINX Unit on Ubuntu
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ];then
>&2 echo "This script requires root level access to run"
exit 1
fi
if [ -z "${WORDPRESS_DB_PASSWORD}" ]; then
>&2 echo "WORDPRESS_DB_PASSWORD must be set"
>&2 echo "Here is a random one that you can paste:"
@hanazuki
hanazuki / adblock.txt
Last active September 25, 2023 14:50
blocklists
[Adblock Plus 2.0]
! Title: PersonalList
@@||*.fastly-analytics.com
@@||js.rtoaster.jp/Rtoaster.js
||j.wovn.io
||d.shutto-translation.com
@carlosedp
carlosedp / gist:f85274ef2a9bacc773cf8ddeedaee821
Created August 8, 2018 23:33
Go 1.11 Benchmark on ARM64
Go 1.10.3 vs 1.11beta3
Linux Firefly3399 4.4.138 #3 SMP Sat Jul 21 18:29:19 EST 2018 aarch64 GNU/Linux
go test crypto/tls -bench BenchmarkThroughput
benchmark old ns/op new ns/op delta
BenchmarkThroughput/MaxPacket/1MB-6 215113025 30982856 -85.60%
BenchmarkThroughput/MaxPacket/2MB-6 373540806 47685945 -87.23%
BenchmarkThroughput/MaxPacket/4MB-6 662471229 64692820 -90.23%
BenchmarkThroughput/MaxPacket/8MB-6 1297366168 121892691 -90.60%
@ivan-loh
ivan-loh / README.md
Last active September 30, 2022 19:13
netcat tcp proxy, for mapping ports on a remote machine to a local machine

Helper script to map ports to other servers.

Use Case

had a database that was only accesible in the VPC on aws, so i created an dev intance and did a ssh tunnel to that dev instance with netcat mapping the port to the database

Sample Usage

Forward all request from local 5432 to remote host google.com port 80

./nc-proxy.sh 5432 google.com 80
@voluntas
voluntas / new_to_mqtt.rst
Last active October 2, 2023 06:26
初めての MQTT
/*
Copyright © 2014 Hidekazu Kobayashi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
#!/usr/bin/env php
<?php
function wsse_header($username, $password) {
// Needed to change hashing, so not nounces with '/' inside will not be generated.
$nonce = sha1(uniqid(null, true) . uniqid());
$created = new DateTime('now', new DateTimezone('UTC'));
$created = $created->format(DateTime::ISO8601);
$digest = sha1($nonce.$created.$password, true);
@imaya
imaya / gist:7215823
Last active July 13, 2017 19:46
転職先の募集

転職先の募集

これは退職エントリではなく退職届を出したので転職先を募集する求職エントリです。

退職と転職先募集

これといった大きな理由はないのですが細かい不満が溜まったため、今年いっぱいで退職することになりました。 細かい不満といってもチームメンバーや業務内容に文句があるわけではなく、逆に素晴らしい環境を提供していただいたと感謝しています。

@ww24
ww24 / windowManager.js
Created June 23, 2012 13:04
Window Manager
window.windowManager = (function () {
var orgOpen = open,
windows = [];
window.open = function () {
var win = orgOpen.apply(null, arguments);
windows.push({
option: arguments,
window: win
});
return win;
@matope
matope / Dynamo: Amazonの高可用性Key-value Store.markdown
Last active November 18, 2022 17:54
Dynamo: Amazonの高可用性Key-value Store[和訳]