Skip to content

Instantly share code, notes, and snippets.

View yskszk63's full-sized avatar
🗾
I'm here.

yusuke suzuki yskszk63

🗾
I'm here.
  • Tokyo, Japan
  • 00:26 (UTC +09:00)
  • X @yskszk63
View GitHub Profile
@greymd
greymd / sudo新一.md
Last active June 12, 2024 06:03
sudo新一

 オレは高校生シェル芸人 sudo 新一。幼馴染で同級生の more 利蘭と遊園地に遊びに行って、黒ずくめの男の怪しげな rm -rf / 現場を目撃した。端末をみるのに夢中になっていた俺は、背後から近づいてきたもう1人の --no-preserve-root オプションに気づかなかった。 俺はその男に毒薬を飲まされ、目が覚めたら・・・ OS のプリインストールから除かれてしまっていた!

sudo がまだ $PATH に残っていると奴らにバレたら、また命を狙われ、他のコマンドにも危害が及ぶ』

 上田博士の助言で正体を隠すことにした俺は、 which に名前を聞かれて、とっさに『gnuplot』と名乗り、奴らの情報をつかむために、父親がシェル芸人をやっている蘭の $HOME に転がり込んだ。ところが、このおっちゃん・・・とんだヘボシェル芸人で、見かねた俺はおっちゃんになりかわり、持ち前の権限昇格能力で、次々と難タスクを解決してきた。おかげで、おっちゃんは今や世間に名を知られた名エンジニア、俺はといえばシェル芸 bot のおもちゃに逆戻り。クラスメートの convertojichattextimg にお絵かきコマンドと誤解され少年ワンライナーお絵かき団を結成させられる始末。

 ではここで、博士が作ってくれたメカを紹介しよう。最初は時計型麻酔 kill 。ふたについた照準器にあわせてエンターを押せば、麻酔シグナルが飛び出し、プロセスを瞬時に sleep させることができる。 次に、蝶ネクタイ型 banner 。裏についているダイヤルを調整すれば、ありとあらゆる大きさのメッセージを標準出力できる。必殺のアイテムなら fork 力増強シューズ。電気と磁力で足を刺激し、 :(){ :|:& };: でプロセステーブ

@andrebrait
andrebrait / keychron_linux.md
Last active June 14, 2024 03:00
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

#!/bin/bash
# DEPENDENCY: bash (or zsh), aws-cli, ruby, fzf, highlight
# AWS Profile Selector
function aws-profile() {
# profile 名のリスト選択
local __profile=$(select-aws-profile $@)
@streamich
streamich / lambda.js
Last active April 29, 2024 19:45 — forked from maxbeatty/lambda.js
using node-postgres (`pg`) in AWS Lambda
import λ from "apex.js";
import { Pool } from "pg";
// connection details inherited from environment
const pool = new Pool({
max: 1,
min: 0,
idleTimeoutMillis: 120000,
connectionTimeoutMillis: 10000
});
@Informatic
Informatic / domain.xml
Last active May 28, 2024 11:44
How to use Windows 10 OEM license in libvirt VM (<smbios mode='host' /> does not work as Windows seems to verify UUID; apparmor/security configuration changes may be needed)
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<!-- ... -->
<qemu:commandline>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/slic.bin'/>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/msdm.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='file=/some/path/smbios_type_0.bin'/>
<qemu:arg value='-smbios'/>
@souri-t
souri-t / Hieroglyph-Unicode.md
Last active March 12, 2024 14:38
ヒエログリフ変換表

ヒエログリフ変換表

ヒエログリフとは

ヒエログリフとは、紀元前3000年頃から紀元400年頃まで古代エジプトで使用された象形文字の一つ。現代でも使用されるアルファベットの原型。19世紀にフランスのシャンポリオンによって解読された。

この表について

ヒエログリフと現代文字の変換表を元に、Unicodeで記述した表です。
Unicode 5.2.0 (U+13000 - U+1342F Egyptian Hieroglyphs)に基づいています。

Unicode Egyptian Hieroglyphs

@olegch
olegch / load-cloudformation-jyaml.js
Created February 9, 2017 21:18
Loading a CloudFormation yaml file with custom tags with js-yaml in node.js
'use strict';
var fs = require('fs');
var yaml = require('js-yaml');
var inputStr = fs.readFileSync('../../out/aws-cloud-formation-template-1.template', {encoding: 'UTF-8'});
var CF_SCHEMA = yaml.Schema.create([
new yaml.Type('!Ref', { kind: 'scalar', construct: function (data) { return { 'Ref': data }; } }),
new yaml.Type('!Equals', { kind: 'sequence', construct: function (data) { return { 'Fn::Equals': data }; } }),
@gwind
gwind / go-netlink-socket-monitor.go
Created December 2, 2016 02:30
[go-netlink-socket-monitor] like ss -t. inetdiag.go is copy from https://github.com/eleme/netlink/blob/master/inetdiag.go , but fix some issues.
@yeokm1
yeokm1 / Read-only FS on Arch Linux ARM.md
Last active June 5, 2024 18:56
Set up Arch Linux ARM on Raspberry Pi to boot from and use a read-only file-system

Read-only FS on Arch Linux ARM

Unlike your typical computer where you usually shutdown properly, I cannot rely on this during the use of my Raspberry Pi. If the Raspberry Pi is improperly shutdown too many times, data corruption in the file system leading to unbootable SD card may result. So we should use a read-only file system.

Full instructions and explanations are obtained from this link but you can run these commands directly. I modified some of the instructions for personal convenience.

Login with default username: alarm, password: alarm

#Optionally enable root over SSH. The rest of these instructions assume u are in root.
@austinmarton
austinmarton / sendRawEth.c
Created February 27, 2012 08:40
Send a raw Ethernet frame in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>