Skip to content

Instantly share code, notes, and snippets.

View moriyoshi's full-sized avatar
😎
I do what to do.

Moriyoshi Koizumi moriyoshi

😎
I do what to do.
View GitHub Profile
#include <errno.h>
#include <unistd.h>
#include <pthread.h>
#include <signal.h>
static pthread_t thr;
static pthread_mutex_t mtx1 = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t cond1 = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t mtx2 = PTHREAD_MUTEX_INITIALIZER;
@moriyoshi
moriyoshi / gist:bc20d99289b05c3dd7c5c7b7857330a2
Created November 16, 2019 17:52
WG1800HP2 boot sequence
IPL:HARD-RESET
memory test ... ok
flinstall OK
boot version: 1.0.0
PKG "3x3LIGHTNING"
CPU "Atheros/QCA9558"
Revision 113.0 CLOCK 720.0 MHz
HEAP MEMORY 262144 bytes
@moriyoshi
moriyoshi / gist:ddc1d7b9c2d3f4f192c39678c1d8d789
Created November 16, 2019 17:52
WG1800HP2 boot sequence
IPL:HARD-RESET
memory test ... ok
flinstall OK
boot version: 1.0.0
PKG "3x3LIGHTNING"
CPU "Atheros/QCA9558"
Revision 113.0 CLOCK 720.0 MHz
HEAP MEMORY 262144 bytes
@moriyoshi
moriyoshi / app.ini
Last active November 4, 2019 06:41
run it with `gunicorn --paste app.ini`
[app:main]
use = call:server:paster_main
[server:main]
use = egg:gunicorn#main
host = 0.0.0.0
port = 8000
workers = 1
FROM docker:dind
RUN apk add dumb-init
COPY start.sh /
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/start.sh"]
<?php
function lz4decodeframes($in) {
if (substr($in, 0, 4) !== "\x04\x22\x4d\x18") {
throw new Exception();
}
$o = 6;
$f = ord($in[4]);
if ($f & 8) {
$o += 8;
}
Copyright (c) 2014 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
import (
"context"
"sync/atomic"
"time"
)
type Contexts struct {
ReaderContext context.Context
ReaderCancel context.CancelFunc
WriterContext context.Context
import ctypes
__all__ = (
'ProcessSerialNumber',
'TransformProcessType',
'SetFrontProcess',
'kProcessTransformToForegroundApplication',
'kProcessTransformToBackgroundApplication',
'kProcessTransformToUIElementAppication',
'kNoProcess',
#!/bin/sh -e
# chkconfig: 345 99 01
# description: Percona Toolkit heartbeat daemon
### BEGIN INIT INFO
# Provides: pt-heartbeat
# Required-Start: mysql
# Required-Stop: $local_fs $network $remote_fs
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: start and stop pt-heartbeat