Skip to content

Instantly share code, notes, and snippets.

@yoneken
yoneken / ddclient-mydns-patch.txt
Created July 26, 2012 03:00
This is a patch to add mydns support for ddclient. The original patch is written by ta-ta. Thanks!
--- ddclient.orig 2012-07-16 23:32:28.000000000 +0900
+++ /usr/sbin/ddclient 2012-07-20 00:07:06.000000000 +0900
@@ -429,6 +429,11 @@
'login' => setv(T_LOGIN, 0, 0, 0, 'unused', undef),
'client' => setv(T_STRING, 0, 1, 1, $program, undef),
},
+ 'mydns-common-defaults' => {
+ 'min-interval' => setv(T_DELAY, 0, 0, 1, interval('30s'), 0),
+ 'max-interval' => setv(T_DELAY, 0, 0, 1, interval('3d'), 0),
+ 'server' => setv(T_FQDNP, 1, 0, 1, 'www.mydns.jp', undef),
@yoneken
yoneken / bkup_wiki.sh
Created July 26, 2012 04:15
A shell script for backup a mediawiki data.
#!/bin/sh
filename=~/bkup/wiki$(date +%Y%m%d).xml
ssh mediawiki_serv php ./www/wiki/maintenance/dumpBackup.php --full > $filename
md5=`md5sum $filename | cut -c 1-32`
lmd5=`cat ~/bkup/last_md5`
if [ "$lmd5" != "$md5" ]
then
echo "$md5" > ~/bkup/last_md5
#echo "The latest backup file is not same with last one."
@yoneken
yoneken / remove_CLI_tools.sh
Created August 7, 2012 11:03
Xcode Command Line Tools Uninstaller
# remove_CLI_tools.sh
# written by cocoanetics:http://www.cocoanetics.com/2012/07/you-dont-need-the-xcode-command-line-tools/
# modified by yoneken
#!/bin/sh
RECEIPT_FILE1=/var/db/receipts/com.apple.pkg.DevSDK.bom
RECEIPT_PLIST1=/var/db/receipts/com.apple.pkg.DevSDK.plist
RECEIPT_FILE2=/var/db/receipts/com.apple.pkg.clang.bom
RECEIPT_PLIST2=/var/db/receipts/com.apple.pkg.clang.plist
@yoneken
yoneken / error_log.txt
Created August 18, 2012 02:42
This is an error message of building OpenRTM-aist on Mac OSX 10.8 (Mountain Lion).
1983 :info:build In file included from ConfigSample.cpp:10:
1984 :info:build In file included from ./ConfigSample.h:14:
1985 :info:build In file included from ../../src/lib/rtm/Manager.h:36:
1986 :info:build In file included from ../../src/lib/rtm/SystemLogger.h:29:
1987 :info:build ../../src/lib/coil/include/coil/stringutil.h:571:12: error: call to function 'operator>>' that is neither visible in the template definition nor found by argument-dependent lookup
1988 :info:build if ((s >> val).fail()) { return false; }
1989 :info:build ^
1990 :info:build ../../src/lib/rtm/RTObject.h:2246:49: note: in instantiation of function template specialization 'coil::stringTo<std::vector<double, std::allocator<double>> >' requested here
1991 :info:build bool (*trans)(VarType&, const char*) = c oil::stringTo)
1992 :info:build ^
@yoneken
yoneken / kicad-macosx.patch
Last active October 31, 2019 22:31 — forked from jboone/kicad-boost-polygon-sort-adaptor.patch
KiCAD and wxWidgets patches to build on Mac OS X and add jboone's hacked-in "magnify" touchpad support
=== modified file 'common/drawpanel.cpp'
--- common/drawpanel.cpp 2013-02-21 20:53:50 +0000
+++ common/drawpanel.cpp 2013-09-02 15:14:40 +0000
@@ -870,6 +870,42 @@
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetEventObject( this );
+ int x, y;
+ GetViewStart( &x, &y );
+
@yoneken
yoneken / eagle2kicad-0.9.1b.ulp
Created November 14, 2012 09:01
This script converts a library of Eagle to one of KiCad.
#usage "<b>KiCAD module exporting tool version 0.8 </b>\n"
"<p>"
"This ULP can exports Eagle CAD Package and Symbol contents into KiCAD lib and module format."
"<p>"
"Load any library from the library directory and execute the ULP."
"<p>"
"<author>Author: Dmitri N. Sytov sdn (at) openhardware.ru</author>"
"<author>Author: juergen.messerer (at) freesurf.ch</author>"
/*
* CHANGELOG=(dd.mm.yyyy)===============================================
#!/usr/bin/env python
from svm import *
from svmutil import *
import numpy as np
import scipy as sp
from pylab import *
s_data = np.genfromtxt('CodeIQ_auth.txt', delimiter=' ')
data = np.genfromtxt('CodeIQ_mycoins.txt', delimiter=' ')
#!/usr/bin/env python
import numpy as np
import scipy as sp
from scipy.cluster.vq import kmeans2,whiten
from pylab import *
s_data = np.genfromtxt('CodeIQ_eaten.txt', dtype='f8,f8,S1', delimiter=' ')
data = np.genfromtxt('CodeIQ_data.txt', delimiter=' ')
@yoneken
yoneken / boost-accumulators.diff
Last active December 18, 2015 02:39
The variation calculated in normal boost is not an unbiased variance but a sample variance. See: http://mathworld.wolfram.com/Variance.html This change makes boost to calculate unbiased variances normally.
diff -ur /opt/local/include/boost/accumulators/statistics/covariance.hpp ../boost/accumulators/statistics/covariance.hpp
--- /opt/local/include/boost/accumulators/statistics/covariance.hpp 2013-05-31 08:41:19.000000000 +0900
+++ ../boost/accumulators/statistics/covariance.hpp 2013-06-05 19:09:33.000000000 +0900
@@ -141,7 +141,7 @@
template<typename Args>
void operator ()(Args const &args)
{
- std::size_t cnt = count(args);
+ cnt = count(args);
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <boost/tokenizer.hpp>
#include <boost/shared_array.hpp>
const std::string FNAME("./vel.csv");
const int SKIP_COLUMNS_NUM = 1;
const int SKIP_ROWS_NUM = 1;