Skip to content

Instantly share code, notes, and snippets.

View kimitoboku's full-sized avatar

Kento KAWAKAMi kimitoboku

View GitHub Profile
@kimitoboku
kimitoboku / 2015-11-19-155500.sh
Created November 19, 2015 06:57
100個の乱数生成
#! /bin/bash
for i in {0..100}
do
cat /dev/urandom | base64 | fold -w 20 | head -n 1 >> download_key
done
@kimitoboku
kimitoboku / 2015-11-16-100231.el
Created November 16, 2015 01:18
prgoram-language-no6-parse
(defun parse (functions data)
(cond ((and (consp functions) (funcall (car functions) (cdr functions) data) ))
((eq functions data) 't)
('t 'nil)))
(defun terminal-symbol (list rest data)
(cond ((and (consp data) (member (car data) list))
(parse rest (cdr data)))
('t 'nil)))
@kimitoboku
kimitoboku / 2015-11-16-091444.el
Created November 16, 2015 00:41
program-language-no6
(defun my-match (pattern data)
(cond ((and (consp pattern) (eq '* (car pattern)))
(or (my-match (cdr pattern) data)
(and (consp data)(my-match pattern (cdr data)))))
((and (consp pattern) (consp data) (eq (car pattern) (car data)))
(my-match (cdr pattern) (cdr data)))
((eq pattern data) 't)
('t nil)))
(defun sample2 (pattern data)
@kimitoboku
kimitoboku / Prompts.d
Last active August 29, 2015 14:27
更新
module Prompts;
extern (C) {
char *getpass(const char *);
}
import std.stdio;
import std.string;
import std.conv;
@kimitoboku
kimitoboku / 11-232801.md
Created July 11, 2015 15:05
Web班課題解答例

Web班勉強会課題解答

課題1 pingを作る

#! /bin/python

import sys
from scapy.all import *
#! /bin/sh
sudo iptables -F
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo /etc/init.d/apache2 restart
sudo sysctl -w vm.drop_caches=3
vmstat 1 700 > status.log &
#! /bin/sh
sudo tail -f /var/log/apache2/p3/access.log | awk '{
d = sprintf("%s-%s",$1,$4)
if($1 ~ /::1/)
{
}else if(list[$1]=="done"){
}else if(!(d in data)){
@kimitoboku
kimitoboku / 25-182834.cpp
Last active August 29, 2015 14:23
n元連立方程式
#include<iostream>
#include<iomanip>
int main(int argc, char *argv[]){
int n;
double input;
std::cout << "n次元の連立方程式:";
std::cin >> n;
double a[n][n];
double e[n][n];
#include<iostream>
#include<iomanip>
int main(int argc, char *argv[]){
int n;
double input;
std::cout << "n次の正方行列? n:";
std::cin >> n;
double a[n][n];
for(int i=0;i<n;i++){
#include<iostream>
#include<iomanip>
int main(int argc, char *argv[]){
int n;
double input;
std::cout << "n次の正方行列? n:";
std::cin >> n;
double a[n][n];
double e[n][n];