Skip to content

Instantly share code, notes, and snippets.

View 10sr's full-sized avatar
👀
I may be slow to respond.

10sr 10sr

👀
I may be slow to respond.
View GitHub Profile
@10sr
10sr / 256colors2.pl
Last active December 24, 2015 19:39
#!/usr/bin/perl
# Author: Todd Larason <jtl@molehill.org>
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $
# download from http://www.frexx.de/xterm-256-notes/data/256colors2.pl
# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades
#!/bin/bash
# prints a color table of 8bg * 8fg * 2 states (regular/bold)
echo
echo Table for 16-color terminal escape sequences.
echo Replace ESC with \\033 in bash.
echo
echo "Background | Foreground colors"
echo "---------------------------------------------------------------------"
for((bg=40;bg<=47;bg++)); do
@10sr
10sr / regtomydns.sh
Last active December 23, 2015 21:29
#!/bin/sh
set -e
curl http://ipv4.mydns.jp/login.html --basic --user username:password >/dev/null 2>&1
logger -t "`basename $0`" "Updating ipv4.mydns.jp succeeded"
@10sr
10sr / README.md
Last active December 21, 2015 04:28
vsftpd.conf for anonymous read-write access without any security configurations

vsftpd Configuration

LAN 内とかでセキュリティが必要ない ftp を vsftpd で立てる方法。 これに加えさらに同時にセキュリティが必要なユーザも利用する方法は知らない。

Directory Permission

--- client.c.orig 2013-06-02 15:29:03.175177500 -0500
+++ client.c 2013-06-02 15:32:59.124455900 -0500
@@ -328,8 +328,12 @@
strlcpy(data.term, term, sizeof data.term) >= sizeof data.term)
*data.term = '\0';
+#ifdef __CYGWIN__
+ snprintf(&data.ttyname, sizeof(data.ttyname), "%s", ttyname(STDIN_FILENO));
+#else
if ((fd = dup(STDIN_FILENO)) == -1)
(defmacro lazy-load-eval (feature &optional functions &rest body)
"Define each FUNCTIONS to autoload from FEATURE.
FEATURE is a symbol. FUNCTIONS is a list of symbols. If FUNCTIONS is nil,
the function same as FEATURE is defined as autoloaded function. BODY is passed
to `eval-after-load'.
When this macro is evaluated, this returns the path to library if FEATURE
found, otherwise returns nil."
(let* ((libname (symbol-name (eval feature)))
(libpath (locate-library libname)))
(and libpath
@10sr
10sr / wl_cfg80211.c.diff
Created April 8, 2012 14:33
broadcom-wl supress annoying output
--- wl_cfg80211.c.orig 2011-10-23 01:55:54.000000000 +0900
+++ wl_cfg80211.c 2012-03-26 22:30:05.000000000 +0900
@@ -1454,7 +1454,7 @@
err = wl_dev_ioctl(dev, WLC_GET_RATE, &rate, sizeof(rate));
if (err) {
- WL_ERR(("Could not get rate (%d)\n", err));
+ // WL_ERR(("Could not get rate (%d)\n", err));
} else {
rate = dtoh32(rate);
@10sr
10sr / reload_driver.sh
Created March 20, 2012 08:52
wicd before connecting reload wlan module
#!/bin/sh
WLINTERFACE="`cat /etc/wicd/manager-settings.conf | grep wireless_interface | sed 's/.*= //'`"
if [ -e "/sys/class/net/$WLINTERFACE/device/driver" ]
then
WLDRIVER=`ls -l /sys/class/net/$WLINTERFACE/device/driver | sed 's#^.*/\([^/]*\)$#\1#'` # expect wl
else
WLDRIVER=""
fi
@10sr
10sr / menu.xml
Last active October 1, 2015 23:08
obmenugen generated menu for openbox
<?xml version="1.0" encoding="UTF-8"?>
<openbox_menu xmlns="http://openbox.org/3.4/menu">
<menu id="xdg-menu" label="Openbox 3" execute="xdg_menu --format openbox3-pipe" />
<menu id="system-menu" label="System">
<item label="Openbox Configuration Manager">
<action name="Execute">
<command>obconf</command>
@10sr
10sr / .fonts.conf
Created March 16, 2012 18:10
my font config
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- http://debian.fam.cx/index.php?Software%2Ffontconfig#i2ccb788 -->
<!-- http://d.hatena.ne.jp/DOSEI/20100604/p2 -->
<alias>
<family>serif</family>
<prefer>