Skip to content

Instantly share code, notes, and snippets.

View aiwas's full-sized avatar
💭
hey

Miyako Kuwano aiwas

💭
hey
View GitHub Profile
@aiwas
aiwas / getrest.php
Last active December 16, 2015 11:08
for old version
<?php
#xxxx-yy-zz形式の文字列から残り日数を求める
function getrest_prs($str) {
date_default_timezone_set('Asia/Tokyo');
$a = date_parse($str);
$year = $a['year']; $month = $a['month']; $day = $a['day'];
$t1 = mktime(0,0,0,$month,$day,$year);
@aiwas
aiwas / synctime.sh
Last active August 29, 2015 14:05
Synchronize hardware clock to NTP
#!/bin/bash
#Sync hardware clock to NTP
apt-get install -y ntpdate
ntpdate ntp.nict.jp
hwclock --systohc
d=$(date +"%Y/%m/%d (%a) %H:%M") ; echo -e "\e[1;36m\e[40m Date : ${d} \e[0m"
c=$(hwclock) ; echo -e "\e[1;32m\e[40m Clock : ${c} \e[0m"
@aiwas
aiwas / ccport.sh
Last active August 29, 2015 14:05
Check some network information of Docker Container
#!/bin/bash
# ccport CONTAINER [option]
# Options $2: port range(nmap option format)
ip=$(sudo docker inspect -f ' {{ .NetworkSettings.IPAddress }} ' $1)
nmap ${ip} $2
@aiwas
aiwas / docker_rmi_nt.sh
Created September 7, 2014 12:45
Remove non-tagged images ( mainly for images failed to build )
#!/bin/bash
# Remove non-tagged images
id=$( docker images | awk '/^<none>/ { print $3 }' | tr '\n' ' ' )
docker rmi ${id}
@aiwas
aiwas / get_minecraft_skinface.php
Created November 13, 2014 20:45
Require PHP>=5.5.0だしテストもしてない
<?php
$user = "$_GET['user']";
$url = "http://s3.amazonaws.com/MinecraftSkins/{$user}.png";
$src = imagecreatefrompng(file_get_contents($url));
$face = imagecrop($src, ['x' => 8, 'y' => 8, 'width' => 8, 'height' => 8]);
header('Content-Type: image/png');
imagepng($face);
@aiwas
aiwas / get_minecraft_skinface.php4
Created November 18, 2014 02:24
Minecraftのスキンの顔部分を取得する奴 4.xでもうごく
<?php
$user = $_GET['user'];
$url = "http://s3.amazonaws.com/MinecraftSkins/{$user}.png";
$skin = imagecreatefrompng($url);
$face = imagecreatetruecolor(8, 8);
imagecopy($face, $skin, 0, 0, 8, 8, 8, 8);
header('Content-Type: image/png');
@aiwas
aiwas / CardCut.scm
Last active August 29, 2015 14:10
端末のSSからスクフェスのカード部分を切り抜くやつ
(define (script-fu-CardCut img layer)
(gimp-image-rotate img 2)
(gimp-image-resize img 1080 1520 0 -201)
(gimp-layer-resize-to-image-size layer)
(gimp-displays-flush)
) ;end of define
(script-fu-register
[06:02:52] [Client thread/INFO]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.reflect.InvocationTargetException
[06:02:52] [Client thread/INFO]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
[06:02:52] [Client thread/INFO]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[06:02:52] [Client thread/INFO]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.reflect.Method.invoke(Unknown Source)
[06:02:52] [Client thread/INFO]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at Reflector.call(Reflector.java:454)
[06:02:52] [Client thread/INFO]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.RenderGlobal.func_180446_a(RenderGlobal.java:821)
[06:02:52] [Client thread/INFO]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.renderer.EntityRenderer.func_175068_a(EntityR
cabac=1
ref=8
deblock=1:0:0
analyse=0x3:0x133
me=umh
subme=9
psy=1
psy_rd=1.00:0.00
mixed_ref=1
me_range=16
@aiwas
aiwas / niconico_html5.css
Created May 8, 2017 18:29
ニコニコ動画(HTML5プレーヤー)のUserStyleSheet
a { color: teal; }
a:hover { text-decoration: none; }
/*ヘッダー*/
#siteHeader { background-color: #333; }
#siteHeader #siteHeaderInner { background: none; }
#siteHeaderNotificationPremium { display: none !important; }
#siteHeaderNotification span.siteHeaderNotNotifications {
background: none;