This file contains hidden or 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 ( | |
"encoding/json" | |
"sync" | |
"testing" | |
) | |
var jsonStr = `{"url":"http://hoge","score":123,"map":{"123":123,"234":234}}` |
This file contains hidden or 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
# List devices | |
fdisk -l | |
lsblk | |
fdisk /dev/mynewdevice | |
# Check device info | |
blkid /dev/mynewdevice | |
# Format the new device | |
mkfs.ext4 /dev/mynewdevice |
This file contains hidden or 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 | |
# List dangling images | |
docker images --filter dangling=true | |
# List dangling image IDs | |
docker images --filter dangling=true | awk 'NR > 1 { print $3 }' | |
# Remove all dangling images | |
docker images --filter dangling=true | awk 'NR > 1 { print $3 }' | xargs docker rmi |
This file contains hidden or 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 waits = [1, 2, 1, 2, 0, 1, 2, 1, 2]; | |
const p = waits.reduce( | |
function (p, val) { | |
return p.then(function () { | |
return new Promise(function (resolve, reject) { | |
setTimeout( | |
function () { | |
if (val === 0) { | |
console.log(`${val} 秒は待てません`) |
This file contains hidden or 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
<?php | |
$try_count = 50000000; | |
$t0 = microtime(true); | |
for ($i = 0; $i < $try_count; $i++) { | |
$data1 = [ | |
'EU', 'AD', 'AL', 'AT', 'BA', 'BE', 'BG', 'BY', | |
'CH', 'CS', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', |
This file contains hidden or 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
EPOCH = 0 | |
DATE = 1970-01-01 00:00:00 JST | |
all: | |
now: | |
date | |
date +%s | |
date: |
This file contains hidden or 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://serverfault.com/questions/661978/displaying-a-remote-ssl-certificate-details-using-cli-tools | |
# | |
HOST = github.com | |
PORT = 443 | |
all: | |
echo | \ | |
openssl s_client -showcerts -servername $(HOST) -connect $(HOST):$(PORT) 2>/dev/null | \ |
This file contains hidden or 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
#include <stdio.h> | |
#include <string.h> | |
#include <db.h> | |
#define FILE "some.db" | |
int main() { | |
DBT key, data; | |
DBC *cursor; | |
DB *dbp; |
This file contains hidden or 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
yowcow 1896 0.0 0.0 355808 7932 ? Sl Dec01 0:00 /usr/bin/gnome-keyring-daemon --daemonize --login | |
yowcow 1905 0.0 0.1 584264 17612 ? Ssl Dec01 0:00 /usr/lib/gnome-session/gnome-session-binary | |
yowcow 2017 0.0 0.0 11228 324 ? Ss Dec01 0:00 /usr/bin/ssh-agent /usr/bin/im-launch gnome-session | |
yowcow 2028 0.0 0.4 735224 77748 ? Sl Dec01 0:01 /usr/bin/gnome-screensaver --no-daemon | |
yowcow 2041 0.1 1.6 3943988 270740 ? Sl Dec01 1:15 /usr/bin/gnome-shell | |
yowcow 2196 0.0 0.0 614876 14552 ? Sl Dec01 0:00 /usr/lib/gnome-shell/gnome-shell-calendar-server | |
yowcow 2206 0.0 0.2 796656 33320 ? Sl Dec01 0:00 /usr/lib/gnome-online-accounts/goa-daemon | |
yowcow 2221 0.0 0.0 297168 7524 ? Sl Dec01 0:00 /usr/lib/gnome-online-accounts/goa-identity-service | |
yowcow 2279 0.0 0.0 272104 5776 ? Sl Dec01 0:00 /usr/lib/gnome-settings-daemon/gsd-mouse | |
yowcow 2284 0.0 0.1 823184 27856 ? Sl |
This file contains hidden or 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 ( | |
"bufio" | |
"bytes" | |
"fmt" | |
"io" | |
"testing" | |
) |