Skip to content

Instantly share code, notes, and snippets.

@cvsync
cvsync / Minecraft-Backup.sh
Last active April 13, 2019 13:01
Minecraft world data backup script.
#! /bin/sh
#
# Sync Minecraft world data
#
/bin/sh /path/to/Minecraft-Sync.sh
LOCAL_HOME=<バックアップ先ディレクトリー>
TMPFILE=/tmp/minecraft-backup.tmp
@cvsync
cvsync / Minecraft-Sync.sh
Last active April 13, 2019 12:57
Minecraft world data sync by using rsync.
#! /bin/sh
# ^M の入力は CTRL-V CTRL-M
# save-all 後の待ちは実際にセーブが終わるまでどれくらいかかっているか確認して決める
# rsync の / のありなしはとても大事なので注意すること
REMOTE_USER=<サーバー上のユーザー名>
REMOTE_HOST=<サーバー IP アドレスまたはホスト名>
REMOTE_HOME=<サーバー上の Minecraft データの基準ディレクトリ>
@cvsync
cvsync / AVT-C875.txt
Created October 21, 2015 13:09
AVT-C875 USB descriptors via udesc_dump
Standard Device Descriptor:
bLength 18
bDescriptorType 01
bcdUSB 0200
bDeviceClass 00
bDeviceSubClass 00
bDeviceProtocol 00
bMaxPacketSize 64
idVendor 07ca
idProduct 0875
@cvsync
cvsync / mod_dosdetector.c.diff
Created August 28, 2015 03:17
IPv6 アドレスを除外したいなら?
--- mod_dosdetector.c.orig 2015-08-28 12:06:01.000000000 +0900
+++ mod_dosdetector.c 2015-08-28 12:07:32.000000000 +0900
@@ -307,6 +307,11 @@
#endif
}
if(cfg->forwarded || addr.s_addr == 0){
+ struct in6_addr addr6;
+ if (inet_pton(AF_INET6, address, &addr6) == 1) {
+ /* *VALID* IPv6 address */
+ return DECLINED;
@cvsync
cvsync / hoge.c
Last active August 29, 2015 14:02
printf(3) with excess arguments
#include <stdio.h>
int
main()
{
int i = 0, j = 0;
printf("%d\n", i++, i++, i++, j++);
printf("%d %d\n", i, j);
}
@cvsync
cvsync / gist:10ed2118ca5fde90cc7f
Last active August 29, 2015 14:00
Which value is returned by isalpha() ?
/*
* Which value is returned by isalpha() ? by M-Systems, Inc.
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int
main(void)
@cvsync
cvsync / OSX-iconv
Created December 20, 2013 10:13
The result of iconv -l on OS X 10.9 Marvericks
ANSI_X3.4-1968 ANSI_X3.4-1986 ASCII CP367 IBM367 ISO-IR-6 ISO646-US ISO_646.IRV:1991 US US-ASCII CSASCII
UTF-8 UTF8
UTF-8-MAC UTF8-MAC
ISO-10646-UCS-2 UCS-2 CSUNICODE
UCS-2BE UNICODE-1-1 UNICODEBIG CSUNICODE11
UCS-2LE UNICODELITTLE
ISO-10646-UCS-4 UCS-4 CSUCS4
UCS-4BE
UCS-4LE
UTF-16
@cvsync
cvsync / main-pthread_exit.c
Last active December 30, 2015 18:29
Where is my lovely "/proc/net/arp" ?
/*
* Where is my lovely "/proc/net/arp" ? by M-Systems, Inc.
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
@cvsync
cvsync / lpc21isp_194_netbsd61.diff
Created September 10, 2013 03:41
The patch for NetBSD/amd64 6.1. Based on lpc21isp 1.94 (http://sourceforge.net/projects/lpc21isp/).
Binary files lpc21isp.old/adprog.o and lpc21isp/adprog.o differ
Binary files lpc21isp.old/lpc21isp and lpc21isp/lpc21isp differ
diff -urN lpc21isp.old/lpc21isp.c lpc21isp/lpc21isp.c
--- lpc21isp.old/lpc21isp.c 2013-08-11 01:35:38.000000000 +0900
+++ lpc21isp/lpc21isp.c 2013-09-10 12:39:46.000000000 +0900
@@ -1374,8 +1374,8 @@
{
char* num;
num = argv[i] + 6;
- while(*num && isdigit(*num) == 0) num++;
@cvsync
cvsync / gist:5976555
Created July 11, 2013 15:38
xHCI register dump
xhci0: PCI Type 00h Configuration Space Header
xhci0: 00h: 70231b6f
xhci0: 04h: 00100006
xhci0: 08h: 0c033001
xhci0: 0ch: 00000010
xhci0: 10h: f7d00004
xhci0: 14h: 00000000
xhci0: 2ch: 70231b6f
xhci0: 34h: 00000050
xhci0: 60h: 00002030