Skip to content

Instantly share code, notes, and snippets.

@nabe256
nabe256 / gist:e9a13c09bb9bae7ca578b5a4941c122d
Last active July 19, 2018 09:23
move all messages (ruby: net/imap)
require 'net/imap'
imap = Net::IMAP.new('example.com')
imap.authenticate('LOGIN', '[email protected]', 'password')
imap.select('INBOX')
if not imap.list('INBOX', 'testfolder')
imap.create('INBOX.testfolder')
end
imap.expunge
imap.uid_search(["FROM", "[email protected]"]).each_with_index do |message_id, i|
#!/bin/bash
urls=(\
"https://aws.amazon.com/jp/ 200" \
"https://aws.amazon.com/console/ 200" \
"https://console.aws.amazon.com/ 302" \
)
for (( i = 0; i < ${#urls[@]}; i++ ))
do
import System.Random
main = do
gen1 <- getStdGen
let rand = getRandom gen1
print . showKiyoshi . getKiyoshi $ rand
text :: [String]
text = ["zun", "doko", "kiyoshi"]
import System.Random
import Control.Monad
main :: IO()
main = print showKiyoshi
getRandomInt :: IO Int
getRandomInt = getStdRandom $ randomR (0,1) :: IO Int
text :: [String]
$ coqtop
Welcome to Coq 8.4pl4 (June 2014)
Coq < Definition proof0 : forall (P Q : Prop), ((P \/ Q) /\ ~P) -> Q.
1 subgoal
============================
forall P Q : Prop, (P \/ Q) /\ ~ P -> Q
proof0 < intros.
$ sudo apt-get install nginx
$ sudoedit /etc/apache2/apache2.conf /etc/apache2/ports.conf
#Listen 80
Listen 8080
$ sudo service apache2 restart
$ sudo service nginx start
$ sudo apt-get install php5-fpm php5-cgi
$ sudo service php5-fpm start
$ sudoedit /etc/nginx/sites-available/default
@nabe256
nabe256 / gist:3a927ee6da681ef3cc5a
Created November 2, 2014 09:36
git bare repository
$ cd /var/git
(a)
$ git clone --bare /var/www/html/project project.git
(b)
$ mkdir project.git ; sudo chown -R user:user project.git
$ cd project.git ; git init --bare
$ cd /var/www/html/project ; git push /var/git/project.git master
$ cd /var/git/project.git
# Tomcat
```
$ sudo apt-get install lamp-server^
$ sudo apt-get install tomcat7 tomcat7-admin tomcat7-user
$ sudoedit /etc/default/tomcat7
JAVA_HOME=/usr/lib/jvm/default-java
$ sudoedit /etc/tomcat7/tomcat-users.xml
<tomcat-users>
<user username="admin" password="pass" roles="manager-gui,admin-gui"/>
"=============================================================================
" Description: UTF-8化と文字コード自動認識設定
" http://www.kawaz.jp/pukiwiki/?vimを改変
" Author: fuenor <[email protected]>
" http://sites.google.com/site/fudist/Home/vim-nihongo-ban/vim-utf8
" Last Modified: 2011-03-06 13:03
" Version: 1.18
"=============================================================================
let s:MSWindows = has('win95') + has('win16') + has('win32') + has('win64')
diff --git a/index.js b/index.js
index 0bcad82..6344b71 100755
--- a/index.js
+++ b/index.js
@@ -51,7 +51,8 @@ function request(str, cb) {
method: 'POST',
headers: {
'Content-length': str.length,
- 'Content-Type': 'text/plain'
+ 'Content-Type': 'text/plain',