Skip to content

Instantly share code, notes, and snippets.

View sumikawa's full-sized avatar

Munechika Sumikawa sumikawa

View GitHub Profile
@sumikawa
sumikawa / sshi
Last active February 1, 2019 01:31
ssh to ec2 by instance name
#!/usr/bin/env ruby
require 'optparse'
m = /((?<user>[\w-]+)@)?((?<instance>i-[\w]+)|(?<name>[\w]+))/.match(ARGV.pop)
user = m[:user] || "ec2-user"
if m[:instance]
dnsname = `aws ec2 describe-instances --instance-ids #{m[:instance]} | jq -r '.Reservations[].Instances[].NetworkInterfaces[].Association.PublicDnsName' | grep -v null | tail -1`
end
if dnsname.nil? || dnsname.empty?
puts "No such instance"
aws ec2 run-instances --image-id ami-bdcda3bc --key-name xxxxxxx --instance-type t2.micro --block-device-mapping '[ {"DeviceName":"/dev/xvda","Ebs":{"VolumeType":"gp2","VolumeSize":10}} ]'
diff --git files/prefpane/checkbox.xml files/prefpane/checkbox.xml
index 152a9c6..df6156e 100644
--- files/prefpane/checkbox.xml
+++ files/prefpane/checkbox.xml
@@ -1018,6 +1018,14 @@
<name>Remap Command_L to Option_L</name>
<sysctl>remap.app_term_commandL2optionL</sysctl>
</item>
+ <item>
+ <name>Remap Ctrl+Tab to Command+Shift+BracketRight</name>
<?xml version="1.0"?>
<root>
<list>
<item>
<name>Ctrl+Tab for Terminal</name>
<identifier>private.sumikawa_ctrlTabForTerminal</identifier>
<only>TERMINAL</only>
<autogen>--KeyToKey-- KeyCode::TAB, VK_CONTROL | ModifierFlag::NONE, KeyCode::BRACKET_RIGHT, ModifierFlag::COMMAND_R | ModifierFlag::SHIFT_R</autogen>
<autogen>--KeyToKey-- KeyCode::TAB, VK_CONTROL | VK_SHIFT | ModifierFlag::NONE, KeyCode::BRACKET_LEFT, ModifierFlag::COMMAND_R | ModifierFlag::SHIFT_R</autogen>
</item>
hint.apm.0.disabled="1"
hint.acpi.0.disabled="1"
beastie_disable="YES"
if_ed_load="YES"
hint.ed.0.at="isa"
hint.ed.0.disabled="0"
hint.ed.0.port="0x300"
hint.ed.0.irq="10"
hint.ed.0.maddr="0xd8000"
hint.ed.1.at="isa"
--- /etc/ttys Mon Aug 23 21:43:13 2004
+++ ttys Fri Feb 24 10:01:57 2006
@@ -30,18 +30,9 @@
#
# If console is marked "insecure", then init will ask for the root password
# when going to single-user mode.
-console none unknown off secure
+console "/usr/libexec/getty std.9600" vt100 on secure
#
ttyv0 "/usr/libexec/getty Pc" cons25 on secure
# Device Mountpoint FStype Options Dump Pass#
/dev/ad0s1b none swap sw 0 0
/dev/ad0s1a / ufs rw 1 1
proc /proc procfs rw 0 0
#
# GENERIC -- Generic kernel configuration file for FreeBSD/i386
#
# For more information on this file, please read the handbook section on
# Kernel Configuration Files:
#
# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
--- xf86Config.c.orig Sat Apr 3 01:09:48 1999
+++ xf86Config.c Sat Apr 3 01:10:57 1999
@@ -3464,7 +3464,7 @@
driver->clocks = 2;
}
- if ((p->Clock / 1000) > (driver->maxClock / 1000))
+ if (0)
clock_too_high = TRUE;
else
--- Lite.pm- Tue Mar 27 19:51:15 2007
+++ Lite.pm Tue Mar 27 17:39:37 2007
@@ -1369,7 +1369,7 @@
}
my $tagattrs = join($tagjoiner, '', map { sprintf '%s="%s"', $_, SOAP::Utils::encode_attribute($attrs->{$_}) }
grep { $_ && defined $attrs->{$_} && ($_ ne 'xsi:type' || $attrs->{$_} ne '')
- } keys %$attrs);
+ } sort keys %$attrs);
if ($value gt '') {