Skip to content

Instantly share code, notes, and snippets.

View haniokasai's full-sized avatar
📈
Studying Econometrics

haniokasai haniokasai

📈
Studying Econometrics
View GitHub Profile
@znz
znz / battwalker.rb
Created October 8, 2009 00:06
battwalker改変(中途半端でバグあり)
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
=begin
Name: battmonwalker.rb
Version: 0.41
Date: 2009-09-27
Author: moyashi <hitoriblog_NO_NO_SPAM@gmail.com>
Description: Alternate battery status indicator for SHARP NetWalker
Modified by: znz
@shoghicp
shoghicp / Comparator.php
Last active July 26, 2020 21:36
Minecraft PE .lst Information Extractor to obtain Protocol Information and Compare Versions
<?php
define("COMPARATOR_VERSION", "0.1");
ini_set("memory_limit", "512M");
$node1 = json_decode(@file_get_contents($argv[1]), true);
if($node1 == ""){
echo "Provide a valid json file produced by the Extractor".PHP_EOL;
exit(1);
}
$node2 = json_decode(@file_get_contents($argv[2]), true);
@kitak
kitak / gist:5974526
Last active March 27, 2019 13:13
KVS導入(ダイレクトルーティング)
# lb001.kitak.pbでの操作
sudo yum install ipvsadm
sudo chkconfig --add ipvsadm
sudo chkconfig ipvsadm on
sudo su - -c 'echo "1" > /proc/sys/net/ipv4/ip_forward'
sudo ifconfig eth0:0 192.168.46.30 netmask 255.255.255.0
sudo vi /etc/sysconfig/network-scripts/ifconfig-eth0 #次回起動時も有効にする
sudo ipvsadm -A -t 192.168.46.30:80 -s rr # 転送元のIPアドレス、ポート
sudo ipvsadm -a -t 192.168.46.30:80 -r 192.168.46.83:80 -g # 転送先のIPアドレス、ポート
sudo ipvsadm -Ln # 確認
@myamamic
myamamic / HttpAuthenticationDialog.java
Created November 7, 2013 09:01
[android][java] WebViewでBasic認証入力ダイアログを出す
package com.example.sample;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
@murachi1208
murachi1208 / file0.txt
Last active March 27, 2019 13:12
Vagrant で CentOS6.6, LVS (IPVS) の NAT 転送方法をためしてみる, その1 ref: http://qiita.com/murachi1208/items/dafcd2d4b1a7d52bfec0
config.vm.define :nictest do |node|
node.vm.network :public_network, ip: "192.168.0.201"
node.vm.network :private_network, ip: "192.168.11.117"
end
# WindowsからLinuxのターミナルを開くまで
以下の方法でターミナルを開いたあと、firefox &等のコマンドを打てばguiアプリケーションが立ち上がる。
方法2がおすすめ。
## 方法1
http://kaiseki-web.lhd.nifs.ac.jp/gecev/xming/Xming.htm
## 方法2
http://vogel.at.webry.info/201310/article_6.html
@shoghicp
shoghicp / commands.md
Last active October 29, 2023 18:16
Some interesting commands to play with the new NBT support for items.

Items with custom name

give sho stick 1 {display:{Name:"§r§6§lNormal stick"}}

Items with enchantments

give sho gold_sword 1 {ench:[{id:9s,lvl:2s}]}
@CryptoRox
CryptoRox / gist:66c471bfc0d41067ba91
Last active March 17, 2018 15:17
TradingView - 1 Minute Forex Scalping Strategy
//Strategy taken from http://www.dolphintrader.com/1-min-easy-forex-scalping-strategy/
//@version=2
strategy("1 min forex scalping", shorttitle="Scalping", overlay=true)
a = ema(close, 12)
b = ema(close, 26)
c = sma(close, 55)
TP = input(0)
SL = input(0)
TS = input(0)
@gbaman
gbaman / HowToOTG.md
Last active June 15, 2024 17:17
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@ohtomi
ohtomi / start_cgi_http_server.sh
Last active July 21, 2022 03:39
File Upload CGI Script written in Python
#!/bin/bash
mkdir ./cgi-bin/
cp upload.cgi ./cgi-bin/
chmod +x ./cgi-bin/upload.cgi
mkdir ./upload/
python -m CGIHTTPServer 8080