Skip to content

Instantly share code, notes, and snippets.

View buty4649's full-sized avatar

buty4649 buty4649

View GitHub Profile
Script started on Fri 24 Jan 2020 11:09:46 PM JST
]0;root@api001: ~root@api001:~# bash servergroup.py
+ nyah_servergroup_add_member.py a0070db6-627c-47b4-b1ed-8acc8d2f30cf b535478d-fa6b-4068-8fd4-1b653c1d0d71
Option "logdir" from group "DEFAULT" is deprecated. Use option "log-dir" from group "DEFAULT".
Option "verbose" from group "DEFAULT" is deprecated for removal. Its value may be silently ignored in the future.
Option "notification_driver" from group "DEFAULT" is deprecated. Use option "driver" from group "oslo_messaging_notifications".
Could not load nova.openstack.common.notifier.rpc_notifier
Could not load nova.openstack.common.notifier.rpc_notifier
/usr/lib/python2.7/dist-packages/pymysql/cursors.py:158: Warning: '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
result = self._query(query)
❯ docker run -it --rm centos:7 bash
[root@ebd7f940179c /]# mkdir test
[root@ebd7f940179c /]# cd test
[root@ebd7f940179c test]# chmod 000 .
[root@ebd7f940179c test]# find /tmp
/tmp
/tmp/.Test-unix
/tmp/ks-script-rnBCJB
/tmp/.font-unix
/tmp/.XIM-unix
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@buty4649
buty4649 / dstat_snat.py
Created June 27, 2018 12:54
dstatでsnat netnsごとにトラフィックを見る奴
class dstat_plugin(dstat):
def __init__(self):
self.nick = ('#recv', '#send')
self.type = 'd'
self.width = 5
self.scale = 1024
self.cols = 2
def vars(self):
@buty4649
buty4649 / led.cow
Created June 6, 2018 08:19
cowsayのLED
$color1=`tput setaf 7;tput setab 21`;
$color2=`tput setaf 7;tput setab 19`;
$color3=`tput setaf 7;tput setab 17`;
$clear=`tput sgr0`;
$the_cow = <<EOC;
$thoughts
$thoughts
$color3 $clear
$color3 $color2 $color1.-.$color2 $color3 $clear
$color3 $color2 $color1.' '.$color2 $color3 $clear

GR-CITRUSにKernel#shiftOutを実装したので、SN74HC595Nを使って制御してみた。

動画: https://youtu.be/y6mvuK9XPx8

接続方法

GR-CITRUS SN74HC595N
5V -> Vcc
QA~QH -> LEDへ
@buty4649
buty4649 / keyboard-layout_helix_default.json
Last active March 6, 2018 10:08
keyboard-layout-editor.com のHelixテンプレート
[
{
"name": "Helix (https://github.com/MakotoKurauchi/helix)",
"author": "@pluis9"
},
[
"~\n\n\n\n\n\n\n\n\n`",
"!\n\n\n\n\n\n\n\n\n1",
"@\n\n\n\n\n\n\n\n\n2",
"#\n\n\n\n\n\n\n\n\n3",
@buty4649
buty4649 / smartctl.md
Created January 23, 2016 16:13
ADATAのSSDのSMART
$ date
2016年  1月 24日 日曜日 01:13:14 JST
$ sudo smartctl -a /dev/sde
smartctl 6.4 2015-06-04 r4109 [x86_64-linux-3.17.8-gentoo-r1] (local build)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     SandForce Driven SSDs
Device Model:     ADATA SSD S510 120GB
@buty4649
buty4649 / mackerel-snmp-agent.sh
Created December 22, 2015 14:53
Ciscoスイッチ向けmackerel agentスクリプト
#!/bin/bash
if [ -z "$1" ];
then
echo "Usage $(basename $0) <host>"
exit 1
fi
TARGET="$1"
MACKEREL_APIKEY="API Key"
{
init: function(elevators, floors) {
var FLOOR_NUM = floors.floorNum;
var elevator1 = elevators[0]; // 初号機
var elevator2 = elevators[1]; // 弐号機
elevator1
.on("idle", function() {
elevator1.goToFloor(0);
});