Skip to content

Instantly share code, notes, and snippets.

View fasterthanlime's full-sized avatar
🌃
4 oreos from heaven

Amos Wenger fasterthanlime

🌃
4 oreos from heaven
View GitHub Profile
@fasterthanlime
fasterthanlime / 001_concurrent_writes.go
Last active December 31, 2016 15:26
TIL: it's possible to open the same path twice (even on Windows!) - it might not be a good idea, though.
package main
import (
"io/ioutil"
"log"
"os"
)
func main() {
path := "sample.txt"
@import 'https://fonts.googleapis.com/css?family=Roboto';
#inner_column
{
width: 1920px;
}
.view_game_page .user_formatted iframe
{
dpkg --add-architecture i386
apt-get update
apt-get install libasound2-dev:i386 libpulse-dev:i386 libgl1-mesa-dev:i386 libwayland-dev:i386 libopenal-dev:i386 libmpg123-dev:i386 libvorbis-dev:i386 libtheora-dev:i386 libfreetype6-dev:i386
@fasterthanlime
fasterthanlime / cron.daily
Created August 2, 2016 19:13
(BSD-licensed)
#!/bin/sh
#
# Copyright (c) 2015 Slack Technologies. Original version from Google Chrome,
# license is below.
#
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# It creates the repository configuration file for package updates, and it
{
"lsarFormatVersion": 2,
"lsarContents": [
{
"XADCompressedSize": 82796,
"XADDataLength": 82796,
"ZipFlags": 0,
"ZipFileAttributes": 0,
"XADDataOffset": 44,
"XADIndex": 0,

Supported popular formats

Format Support level Notes
Zip Full Full support for the normal zip format, with additional support for AES encryption, Zip64 extensions for large files, Mac OS extensions of many different kinds, and several unusual compression methods (Deflate64, Bzip, LZMA, PPMd). Can also extract .EXE self-extracting files using Zip.
RAR Full Including encryption and multiple volumes. Can also extract .EXE self-extracting files using RAR.
7z No encryption Most compression methods are supported, but no encryption. Also supports Unix extensions.
Tar Full
Gzip Full
Bzip2 Full

THE DROQEN FUNCTION

Specs

The function should pass the following tests

droqen(0, 0) == false
droqen(0, 1) == false
@fasterthanlime
fasterthanlime / goroutine
Last active April 19, 2016 02:52
Is.. is this a race condition when two goroutines are trying to write to the standard output?
goroutine profile: total 6
1 @ 0x77952f 0x7792fa 0x774bdb 0x616d55 0x616f77 0x5246e1 0x525f84 0x526b45 0x5233f5 0x4818e1
# 0x77952f runtime/pprof.writeRuntimeProfile+0xbf C:/Go/src/runtime/pprof/pprof.go:545
# 0x7792fa runtime/pprof.writeGoroutine+0x9a C:/Go/src/runtime/pprof/pprof.go:507
# 0x774bdb runtime/pprof.(*Profile).WriteTo+0xdb C:/Go/src/runtime/pprof/pprof.go:236
# 0x616d55 net/http/pprof.handler.ServeHTTP+0x385 C:/Go/src/net/http/pprof/pprof.go:210
# 0x616f77 net/http/pprof.Index+0x207 C:/Go/src/net/http/pprof/pprof.go:222
# 0x5246e1 net/http.HandlerFunc.ServeHTTP+0x41 C:/Go/src/net/http/server.go:1618
# 0x525f84 net/http.(*ServeMux).ServeHTTP+0x184 C:/Go/src/net/http/server.go:1910
# 0x526b45 net/http.serverHandler.ServeHTTP+0x1a5 C:/Go/src/net/http/server.go:2081
#!/usr/bin/env ruby
layouts = %w(us ch(fr))
current = `setxkbmap -query`.split("\n")[-1].split(':')[-1].strip
next_layout = layouts[(layouts.index(current) + 1) % layouts.size]
`setxkbmap '#{next_layout}'`
`notify-send '#{next_layout}'`
@fasterthanlime
fasterthanlime / glibc-check.sh
Last active May 20, 2025 12:19
Prints the various glibc versions required by an executable
#!/bin/bash
# This scripts lets you check which minimum GLIBC version an executable requires.
# Simply run './glibc-check.sh path/to/your/binary'
#
# You can set `MAX_VER` however low you want, although I (fasterthanlime)
# feel like `2.13` is a good target (For reference, Ubuntu 12.04 has GLIBC 2.15)
MAX_VER=2.13
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )