Skip to content

Instantly share code, notes, and snippets.

View kimitoboku's full-sized avatar

Kento KAWAKAMi kimitoboku

View GitHub Profile
@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];
#!/bin/bash
i=0;
tail -f path | awk '{if(list[$1]=="done"){}else if(list[$1] == $4){print $1;list[$1]="done"}else{list[$1] = $4}}' | while read line
do
i=$(( i + 1 ))
echo "$i:$line"
done
while true
do
D=`data -d '5 seconds ago' +"%d/%b/%Y:%k:%M:%S"`
sleep 1
cat /etc/httpd/logs/access_log | grep "$D" | cut -d " " -f 1 | sort | uniq -c |sort -nr | awk '$1 > 2{print $2}'
done
@kimitoboku
kimitoboku / 05-155821.s
Created June 5, 2015 07:22
音楽を出力するやつ
LD ACC,FFh
ST ACC,(image)
LD ACC,dptr1
ST ACC,(dptr)
L0: LD ACC,(dp
LD IX,ACC
ADD ACC,03h
ST ACC,(dptr)
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
int count_string(char *str,char *s);
int string_length(char *str);
void makeSkipDistArray(int array[],char str[]);
int countStrinInStrings(int sda[],char str[],char word[]);