Skip to content

Instantly share code, notes, and snippets.

penguin2716 / 60_warnning.zsh
Created Jul 8, 2014
source this script in your ~/.bashrc and stop using deprecated package
View 60_warnning.zsh
#!/usr/bin/env zsh
function arp {
echo "use 'ip n' instead."
return 1
function ifconfig {
echo "use 'ip a (ip addr)', 'ip link', or 'ip -s (ip -stats)' instead."
return 1
penguin2716 / mikutter_yo.rb
Created Jun 20, 2014
View mikutter_yo.rb
# -*- coding: utf-8 -*-
Plugin.create :mikutter_yo do
filter_gui_postbox_post do |gui_postbox|
text = Plugin.create(:gtk).widgetof(gui_postbox).widget_post.buffer.text.gsub(/よ/, "Yo") :message => text, text)
Plugin.create(:gtk).widgetof(gui_postbox).widget_post.buffer.text = ''
penguin2716 / mba_autobl.rb
Last active Aug 29, 2015
Automatically adjusts the display brightness of MacBook Air (requires mba6x_bl)
View mba_autobl.rb
# Copyright (c) 2014 Takuma Nakajima
# This software is released under the MIT License.
# ambient light sensor
ALS_SOURCE = '/sys/devices/platform/applesmc.768/light'
penguin2716 / 50-mtrack.conf
Last active Aug 29, 2015
a part of /etc/X11/xorg.conf.d/50-mtrack.conf (and add "xset m 40/10" to your .xprofile)
View 50-mtrack.conf
Section "InputClass"
Identifier "touchpad catchall"
Driver "mtrack"
MatchIsTouchpad "on"
Section "InputClass"
# available options:
Identifier "Multitouch driver settings"
MatchProduct "Apple|bcm5974"
penguin2716 /
Created May 19, 2014
Installation procedure of latest mikutter 3.0.0 for Ubuntu 14.04
# This script will install mikutter 3.0.0 (currently testing release)
# to your fresh Ubuntu 14.04 environment (tested on Server LTS amd64 via ssh -YC)
# install depends
sudo apt-get update
sudo apt-get install ruby2.0 ruby2.0-dev git libgtk2.0-dev fonts-vlgothic
# checkout latest mikutter branch
penguin2716 /
Created May 8, 2014
"Hello, world!"と表示するシェルスクリプト(for 64bit Linux)
This file has been truncated, but you can view the full file.
perl -e 'while (<>) { print pack("H*",$_); }' <<EOF > hello
penguin2716 /
Created May 8, 2014
"Hello, world!"と出力するシェルスクリプト
cat <<EOF > hello.c
#include <stdio.h>
int main(void) {
printf("Hello, world!\n");
return 0;
gcc -o hello hello.c
penguin2716 / mikutter_fav_all_accounts.rb
Created May 7, 2014
View mikutter_fav_all_accounts.rb
# -*- coding: utf-8 -*-
Plugin.create :fav_all_accounts do
proc = Plugin.filtering(:command,[:account_forward][:exec]
name: '全部のアカウントでふぁぼる',
condition: lambda{ |opt| true },
visible: true,
role: :timeline) do |opt|
penguin2716 / mselect.rb
Created Feb 11, 2014
list/select and rewrite ~/.mikutter symlink
View mselect.rb
#!/usr/bin/env ruby
FLOATING_PATH = File.join(ENV["HOME"], ".mikutter")
if File.exists? FLOATING_PATH and not File.symlink? FLOATING_PATH
puts "error: #{FLOATING_PATH} exists but not a symlink"
exit 1
penguin2716 / mikutter_shrink_words.rb
Last active Aug 29, 2015
View mikutter_shrink_words.rb
# -*- coding: utf-8 -*-
Plugin.create :shrink_words do
def shrink_words(src)
str = src
src.scan(/[a-zA-Z_]+/).map{ |s|
if s.size > 3
[s, s[0] + (s.size - 2).to_s + s[-1]]
[s, s]