This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"crypto/sha1" | |
"encoding/base64" | |
"encoding/binary" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"encoding/hex" | |
"fmt" | |
) | |
func main() { | |
id := make([]byte, 16) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
history | dmenu -l 10 | bash |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GREETINGS='HELLO GROOVY AND BASH' | |
echo $GREETINGS | |
#to interpret bash variable , remove single quotes in 'EOF' | |
groovy -e "new GroovyShell().evaluate(System.in.text)" <<'EOF' | |
println("this is groovy print") | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//turn list into map | |
assert [1:2,3:4] == [[1,2],[3,4],[1,2]].collectEntries {it} //{[it[0],it[1]]} | |
//sublist from nth to end | |
assert [3,4,5,6] == [1,2,3,4,5,6][2..-1] | |
assert [3,4,5,6] == [1,2,3,4,5,6][2, 3..-1] | |
//string to number | |
assert 1.2 == "1.2" as double |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s -b "$cookie" "https://class.coursera.org/bitcointech-001/lecture" | grep download.mp4\?lecture_id | awk -F\" '{print $4}' | xargs curl -s -b "$cookie" | awk -F\" '{print $2}' | while read -r line; do wget --content-disposition "$line" ;done | |
while read -r line; do wget --content-disposition "$line"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.surdoc.enterprisecloud.web; | |
import java.io.IOException; | |
import java.net.URLDecoder; | |
import java.net.URLEncoder; | |
import javax.servlet.Filter; | |
import javax.servlet.FilterChain; | |
import javax.servlet.FilterConfig; | |
import javax.servlet.ServletException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public String readMailTest() throws Exception { | |
Properties props = new Properties(); | |
props.put("mail.imap.host", "imap.sina.cn"); | |
Session session = Session.getDefaultInstance(props); | |
IMAPStore store = (IMAPStore) session.getStore("imap"); | |
store.connect("sgmall_test_001", "sgmall_test_001"); | |
Folder emailFolder = store.getFolder("INBOX"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deb http://ubuntu.v2ex.com/ubuntu/ quantal main restricted universe multiverse | |
deb-src http://ubuntu.v2ex.com/ubuntu/ quantal main restricted universe multiverse | |
deb http://ubuntu.v2ex.com/ubuntu/ quantal-updates main restricted universe multiverse | |
deb-src http://ubuntu.v2ex.com/ubuntu/ quantal-updates main restricted universe multiverse | |
deb http://ubuntu.v2ex.com/ubuntu/ quantal-backports main restricted universe multiverse | |
deb-src http://ubuntu.v2ex.com/ubuntu/ quantal-backports main restricted universe multiverse | |
deb http://ubuntu.v2ex.com/ubuntu/ quantal-security main restricted universe multiverse | |
deb-src http://ubuntu.v2ex.com/ubuntu/ quantal-security main restricted universe multiverse | |
deb http://extras.ubuntu.com/ubuntu quantal main | |
deb-src http://extras.ubuntu.com/ubuntu quantal main |
NewerOlder