Skip to content

Instantly share code, notes, and snippets.

@filewalkwithme
filewalkwithme / sample_wol.lua
Created June 4, 2012 00:01
Lua Wake-On-Lan Script
function split(str, pat)
local t = {}
local fpat = "(.-)" .. pat
local last_end = 1
local s, e, cap = str:find(fpat, 1)
while s do
if s ~= 1 or cap ~= "" then
table.insert(t,cap)
end
last_end = e+1
@ck-on
ck-on / ocp.php
Last active March 25, 2024 09:30
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@johnbender
johnbender / prefs.js
Created February 23, 2013 06:20
Set up Chrome Secure Shell to handle solarized terminal colors
// Disable bold.
term_.prefs_.set('enable-bold', false)
// Use this for Solarized Dark
term_.prefs_.set('background-color', "#002b36");
term_.prefs_.set('foreground-color', "#839496");
term_.prefs_.set('color-palette-overrides', [
'#073642',
'#dc322f',
@bcantrill
bcantrill / dtrace-on-rust
Last active May 29, 2023 07:37
DTrace on Rust. This shows running dtrace(1M) on a simple Rust program. Rust is running in a 64-bit LX-branded zone on SmartOS, an illumos derivative. Running stock (alpha) Rust and latest SmartOS.
root@1eec2cd3-2cba-e416-e1b6-845b715b736c:~# uname -a
Linux 1eec2cd3-2cba-e416-e1b6-845b715b736c 3.13.0 BrandZ virtual linux x86_64 x86_64 x86_64 GNU/Linux
root@1eec2cd3-2cba-e416-e1b6-845b715b736c:~# rustc -Vv
rustc 1.0.0-nightly (44a287e6e 2015-01-08 17:03:40 -0800)
binary: rustc
commit-hash: 44a287e6eb22ec3c2a687fc156813577464017f7
commit-date: 2015-01-08 17:03:40 -0800
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly
root@1eec2cd3-2cba-e416-e1b6-845b715b736c:~# cat hello.rs
壹多媒體娛樂服務股份有限公司 壹網樂/網樂通, https://www.nextvod.com.tw/ #nextvod #nextv
H/W
STMicroelectronics STx7105 (Renesas SuperH Core)
VIA VT6113 (Ethernet)
NANYA NT5TU64M16GG-AC (DRAM DDR2 64Mx16 PC800 BGA) * 2
Samsung NCDOM08GMS-MLC (USB DOM 8GB)
Winbond 25Q80 1MB Spi Flash (Onboard Flash)
Console Pin headers
@jperkin
jperkin / pkgin-refresh.md
Last active April 9, 2018 01:09
pkgin refresh changes for testing

Introduction

pkgsrc does things a bit different to most other package managers. When a package is rebuilt using our bulk build mechanism, every other package that depends on it is also rebuilt. So for example, if we upgrade OpenSSL from 1.0.2m to 1.0.2n then every package that uses OpenSSL (and every package that depends on those packages, and so on..) is rebuilt.

We do this to ensure consistency and avoid any nasty surprises. Just because an upstream thinks the ABI is identical it doesn't mean that is true, and you cannot rely on this behaviour. By rebuilding everything that could be affected we have confidence that at least the changes have gone through a build test, and we're not just hoping for the best.

This has served us well in the past and shown up issues that other package managers have been unaware of.

Issues

@munificent
munificent / generate.c
Last active March 18, 2024 08:31
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@ryan-blunden
ryan-blunden / reset_sourcegraph_admin_password.md
Last active April 20, 2023 18:52
Instructions for resetting the Sourcegraph admin password

Presuming you have access to the Sourcegraph Docker container and the container name is sourcegraph:

  1. Get the id for the admin account (should be 1 in most cases):
docker container exec sourcegraph psql -U postgres sourcegraph -c 'SELECT id, username, passwd FROM users'
  1. Set the $ID variable: