Skip to content

Instantly share code, notes, and snippets.

viz3

Block or report user

Report or block viz3

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View calc_game.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
int addition(char *s)
{
int x = ((unsigned)rand() % 99) + 1;
int y = ((unsigned)rand() % 99) + 1;
sprintf(s, "%d + %d = ", x, y);
View nginx.conf
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections 768;
}
View syslog
May 6 15:52:35 ms kernel: [4470728.497803] ata3.00: exception Emask 0x0 SAct 0x803d0 SErr 0x0 action 0x0
May 6 15:52:35 ms kernel: [4470728.499866] ata3.00: irq_stat 0x40000008
May 6 15:52:35 ms kernel: [4470728.501927] ata3.00: failed command: READ FPDMA QUEUED
May 6 15:52:35 ms kernel: [4470728.503947] ata3.00: cmd 60/e8:30:50:85:c4/02:00:e3:00:00/40 tag 6 ncq 380928 in
May 6 15:52:35 ms kernel: [4470728.503947] res 41/40:00:50:85:c4/00:00:e3:00:00/40 Emask 0x409 (media error) <F>
May 6 15:52:35 ms kernel: [4470728.508014] ata3.00: status: { DRDY ERR }
May 6 15:52:35 ms kernel: [4470728.510053] ata3.00: error: { UNC }
May 6 15:52:35 ms kernel: [4470728.522171] ata3.00: configured for UDMA/133
May 6 15:52:35 ms kernel: [4470728.522229] sd 2:0:0:0: [sdc] tag#6 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
May 6 15:52:35 ms kernel: [4470728.522236] sd 2:0:0:0: [sdc] tag#6 Sense Key : Medium Error [current] [descriptor]
@viz3
viz3 / Vagrantfile
Created Mar 11, 2018
EdgeOnWindows10
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
View unescape_access_log.rb
#!/usr/bin/env ruby
require 'uri'
def main
while line = $stdin.gets
row = line.split
row[6] = URI.unescape(row[6])
puts row.join(' ')
end
@viz3
viz3 / README.md
Last active Jun 3, 2017
Mac で Logitech Marble Mouse を使う際に画面スクロールを実現する
View README.md

Karabiner をインストール。

次の項目にチェックを入れる。

Change Key -> Pointing Device -> CursorMove to ScrollWheel -> RightClick+CursorMove to ScrollWheel
View ln_hiragino.rb
#!/usr/bin/ruby
# coding: utf-8
require 'fileutils'
{
"/Library/Fonts/ヒラギノ明朝 Pro W3.otf" => 'HiraMinPro-W3.otf',
"/Library/Fonts/ヒラギノ明朝 Pro W6.otf" => 'HiraMinPro-W6.otf',
"/Library/Fonts/ヒラギノ角ゴ Pro W3.otf" => 'HiraKakuPro-W3.otf',
"/Library/Fonts/ヒラギノ丸ゴ Pro W4.otf" => 'HiraMaruPro-W4.otf',
"/Library/Fonts/ヒラギノ角ゴ Pro W6.otf" => 'HiraKakuPro-W6.otf',
"/Library/Fonts/ヒラギノ丸ゴ ProN W4.otf" => 'HiraMaruProN-W4.otf',
View rename.rb
#!/usr/bin/env ruby
Dir.glob('*.m4a') { |f|
File.rename(f, f.sub(/\ 1.m4a$/, '.m4a'))
}
View gist:11394239
viz@mba:% ./flash-all.sh [~/work/hammerhead-kot49h]
sending 'bootloader' (2508 KB)...
OKAY [ 0.287s]
writing 'bootloader'...
OKAY [ 0.505s]
finished. total time: 0.792s
rebooting into bootloader...
OKAY [ 0.095s]
finished. total time: 0.095s
sending 'radio' (42049 KB)...
View gist:11389911
viz@mba:% ./fastboot flash recovery ~/Downloads/openrecovery-twrp-2.7.0.0-hammerhead.img
sending 'recovery' (13306 KB)...
OKAY [ 0.620s]
writing 'recovery'...
OKAY [ 1.045s]
finished. total time: 1.665s
You can’t perform that action at this time.