Skip to content

Instantly share code, notes, and snippets.

@mutekinootoko
mutekinootoko / wolMac.py
Created February 16, 2021 08:29
mac WOL
#python2
import socket
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto('\xff'*6+'\x70\x73\xc2\xbe\xe3\x0d'*16, ('192.168.0.214', 80)) #mac address and ip
@mutekinootoko
mutekinootoko / build.gradle
Last active August 21, 2019 05:43
simple jar build gradle build file
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/
*/
apply plugin: 'java'
apply plugin: 'eclipse'
:set list
:set listchars=tab:>-
# tab size =4
:set tabstop=4
@mutekinootoko
mutekinootoko / make_github_issue.py
Last active May 17, 2017 15:00 — forked from JeffPaine/make_github_issue.py
Make an issue on github using API V3 and Python
import json
import requests
# Authentication for user filing issue (must have read/write access to
# repository to add issue to)
USERNAME = 'CHANGEME'
PASSWORD = 'CHANGEME'
# The repository to add this issue to
REPO_OWNER = 'CHANGEME'
{
"responseHeader":{
"status":0,
"QTime":1},
"response":{"numFound":1,"start":0,"docs":[
{
"author":"Marku L",
"text":["Marku L",
"titletitle",
"bah bnah blah blah blah ",
@mutekinootoko
mutekinootoko / gist:43d08e88aa4c11c558f6afc57a55f177
Created February 7, 2017 09:49
Diff, show modified line from right file only
diff --unchanged-line-format= --old-line-format= --new-line-format='%L' FILE_A FILE_B
@mutekinootoko
mutekinootoko / saveHistory.py
Created January 2, 2017 09:26
save history from python interpreter
import readline
readline.write_history_file('/home/ahj/history')
@mutekinootoko
mutekinootoko / twofivegram.java
Last active October 31, 2016 07:52
n-gram tokenizer lucene 6
ArrayList<String> grams = new ArrayList<>();
FileReader fr = new FileReader(args[0]);
System.out.println("loading content file: " + args[0]);
BufferedReader br = new BufferedReader(fr);
@mutekinootoko
mutekinootoko / LuceneLab.java
Created October 31, 2016 05:14 — forked from qrtt1/LuceneLab.java
複習 Lucene 的用法 (6.x)
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import org.apache.log4j.Logger;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.cjk.CJKAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.TextField;
@mutekinootoko
mutekinootoko / createCustomViewFromXib.m
Created July 2, 2016 10:51
create a custom uiview from a xib
UINib *nib = [UINib nibWithNibName:@"YourCustomView" bundle:nil];
YourCustomView *view = [[nib instantiateWithOwner:self options:nil] objectAtIndex:0];
[superview addSubview:view];