Skip to content

Instantly share code, notes, and snippets.

View ichikaway's full-sized avatar

Yasushi Ichikawa (ichikaway) ichikaway

View GitHub Profile
@ichikaway
ichikaway / example.pac
Created November 12, 2020 09:19
VAddy-pac-example
function FindProxyForURL(url, host)
{
if(shExpMatch(host,"www.example.com"))
{return "PROXY 54.92.84.100:28888";}
else
return "DIRECT";
}
@ichikaway
ichikaway / bash-parser-sample-with-docker.md
Created October 11, 2018 03:10
bash parser sample with docker

bash parser sample with docker

https://github.com/vorpaljs/bash-parser

docker pull node:8.9.4-alpine
docker run -d --name node-alpine -it node:8.9.4-alpine
docker exec -it node-alpine /bin/sh

vi sample.js

@ichikaway
ichikaway / lfs.md
Last active January 1, 2018 14:29
Linux From Scratch Ubuntu16 step

package install

sudo apt-get install gawk
sudo apt-get install bison
sudo apt-get install make
sudo apt-get install gcc
sudo apt-get install bzip2
sudo apt-get install g++
sudo apt-get install texinfo

<?php
$address = "aaa bb cc";
echo escapeshellarg($address) . PHP_EOL; // 'aaa bb cc'
echo "----------------\n";
//CVE-2016-10045
$address = "\"attacker\' -oQ/tmp/ -X/tmp/phpmailertest/phpcode.php some\"@email.com";
<?php
require 'PHPMailerAutoload.php';
//$address = 'ichikaway@gmail.com';
$address = '"attacker\" -oQ/tmp/ -X/var/www/cache/phpcode.php some"@email.com';
var_dump(PHPMailer::validateAddress($address));
@ichikaway
ichikaway / SampleCmd.php
Created June 21, 2016 05:45
app/Console/Commands/SampleCmd.php
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class SampleCmd extends Command
{
/**
* The name and signature of the console command.
@ichikaway
ichikaway / bash example
Last active August 2, 2016 07:43
bash_example.sh
ctl + a : 行頭移動
ctl + e : 行末移動
esc + b : 一単語左へ移動
esc + f : 一単語右へ移動
ctl + u : カーソルから左をすべて削除
ctl + k : カーソルから右をすべて削除
ctl + d : カーソル文字削除
ctl + h : カーソル前の文字削除
@ichikaway
ichikaway / gist:e20450fe1910f760c613
Last active August 29, 2015 14:21
VAddy Codeship Config Sample
./unit-test.sh
./deploy-staging.sh
git clone git@github.com:vaddy/vaddy-api-ruby.git && cd ./vaddy-api-ruby && ruby vaddy.rb && cd ../
./deploy-production.sh
@ichikaway
ichikaway / CircleCI-VAddy-sample.yml
Last active August 29, 2015 14:10
CircleCI-VAddy-sample
test:
override:
- ./test.sh
deployment:
staging:
branch: master
commands:
- ./deploy.sh
- git clone git@github.com:vaddy/vaddy-api-ruby.git && rvm use 2.1.0 && cd ./vaddy-api-ruby/ && ruby vaddy.rb
- ./deploy2.sh
@ichikaway
ichikaway / gist:3300279
Created August 9, 2012 01:58
cache router url
diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php
index cb28f6e..c6a38c3 100644
--- a/lib/Cake/Routing/Router.php
+++ b/lib/Cake/Routing/Router.php
@@ -810,23 +810,30 @@ class Router {
$url += array('controller' => $params['controller'], 'plugin' => $params['plugin']);
- $match = false;
+ $cacheKey = 'Router-' . sha1(serialize($url));