Skip to content

Instantly share code, notes, and snippets.

View shinshin86's full-sized avatar
👶

Yuki Shindo shinshin86

👶
View GitHub Profile
@shinshin86
shinshin86 / chBrightness.sh
Last active January 11, 2016 02:03
"Change Brightness" shell script
#!/bin/bash
function usage {
cat <<EOF
$(basename ${0}) is a tool for Change a Screen Brightness(Verification environment : Debian7)
Usage:
$(basename ${0}) [command or options]
Command(Selected Brightness):
@shinshin86
shinshin86 / Sample_AtomAndRssGeneratedPelican.xml
Created March 15, 2016 22:18
This RSS and ATOM has been generated by Pelican.
<!--
# This RSS and ATOM has been generated by Pelican
# Pelican is a static site generator, written in Python. Highlights include:
http://docs.getpelican.com/en/3.6.3/
-->
<!-- ATOM Feed -->
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Brewing Heads</title><link href="http://shinshin86.github.io/BrewingHeads/" rel="alternate"></link><link href="http://shinshin86.github.io/BrewingHeads/feeds/all.atom.xml" rel="self"></link><id>http://shinshin86.github.io/BrewingHeads/</id><updated>2016-03-06T00:00:00+09:00</updated><entry><title>BrewingHeads</title><link href="http://shinshin86.github.io/BrewingHeads/brewingheads.html" rel="alternate"></link><updated>2016-03-06T00:00:00+09:00</updated><author><name>shinshin86</name></author><id>tag:shinshin86.github.io,2016-03-06:BrewingHeads/brewingheads.html</id><summary type="html">&lt;h1&gt;Episode 0&lt;/h1&gt;
@shinshin86
shinshin86 / caesar_cipher.py
Created August 6, 2016 11:55
It was create to solve to SECCON2015 online CTF - Excercise (After)
# -*- coding: utf-8 -*-
import sys
def create_dict(c,p):
dic ={}
for i in range(len(c)):
dic[c[i]] = p[i]
return dic
def q_replace(q, dic2):
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import java.util.Random;
public class PasswordGenerate {
/**
* Password generate
*
* @param passLength
* Password length
* @return
# Please use "copy and paste" at Your Python environment.
# I have been tested with Python3.
# Hello World
python -c "print('Hello World')"
# Create Files(Example: Create a 10 pcs "text" file)
python -c "import random;[open(str(random.randint(1, 100000)) +'.txt', 'w').close() for i in list(range(10))]"
# Rename a all file name in the directory("jpg"file)
@shinshin86
shinshin86 / rehalf.py
Last active September 7, 2016 21:41
Image resize to half.
# -*-coding: utf-8-*-
import glob
import os
from PIL import Image;
# Get all of the image files that exist under the "work" directory.
file_list = [r.split('/')[-1] for r in glob.glob('./work/*')]
for f in file_list:
file_extension = os.path.splitext(f)
target_file_extension = [".jpeg", ".jpe", ".jpg", ".JPEG",".png",".PNG",".gif",".GIF",".bmp",".BMP"]
@shinshin86
shinshin86 / setup_for_dev_ubuntu1604.sh
Created September 17, 2016 23:42
Setup for development environment(Ubuntu 16.04)
# setup_for_ubuntu_devmachine
#====================================================================
# Basic setting
#====================================================================
sudo apt-get update -y && sudo apt-get upgrade -y &&
env LANGUAGE=C LC_MESSAGES=C xdg-user-dirs-gtk-update
@shinshin86
shinshin86 / cf.go
Created January 14, 2017 00:02
"cf" display a color text of standard output.
// Usage:
// cf {color} {text}
// colors => black, red, green, yellow, blue, magenta, cyan, white
package main
import (
"fmt"
"flag"
)
@shinshin86
shinshin86 / anonypost_bot_sample.js
Created April 2, 2017 22:33
This is a sample of slack bot for doing anonymous posting.
// Posting anonymously botn sample
// Confirm whether to submit a post => yes / no
controller.hears(['anonypost (.*)'], ['direct_message','direct_mention','mention'], function(bot,message) {
var matches = message.text.match(/anonypost (.*)/i);
var anonypost = matches[1];
bot.reply(message, 'I will post this content anonymously. Is it OK? => ' + anonypost );
bot.startConversation(message, function(err, convo) {
convo.ask('yes / no',
[
{