This file contains hidden or 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 | |
| echo 'Shutdown notice: save all your work. THE SYSTEM IS GOING DOWN!!' | wall |
This file contains hidden or 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
| SELECT | |
| NOW(), | |
| CURDATE(), | |
| CURTIME(), | |
| DATE_ADD(CURDATE(), INTERVAL -100 DAY), | |
| DATE_ADD(CURDATE(), INTERVAL +100 DAY); |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # git-addremove | |
| git add . | |
| git ls-files -deleted | xargs git rm |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE module PUBLIC | |
| "-//Puppy Crawl//DTD Check Configuration 1.3//EN" | |
| "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> | |
| <!-- This is a checkstyle configuration file. For descriptions of | |
| what the following rules do, please see the checkstyle configuration | |
| page at http://checkstyle.sourceforge.net/config.html --> | |
| <module name="Checker"> |
This file contains hidden or 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
| select date_format(str_to_date('11/20/2014', '%m/%d/%Y'), '%Y-%m-%d'); |
This file contains hidden or 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 org.bindiego.junit.test; | |
| import org.junit.runner.RunWith; | |
| import org.junit.runners.Suite; | |
| import org.junit.runners.Suite.SuiteClasses; | |
| @RunWith(Suite.class) | |
| @SuiteClasses({ ParameterizedHelloUnitTest.class, HelloUnitTest.class }) | |
| public class HelloTestSuite | |
| { |
This file contains hidden or 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 | |
| npm outdated | grep -v Package | awk '{print $1}' | xargs -I% npm install %@latest --save |
This file contains hidden or 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 -ex | |
| # 1. To monitor HTTP traffic including request and response headers and message body: | |
| tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | |
| # 2. To monitor HTTP traffic including request and response headers and message body from a particular source: | |
| tcpdump -A -s 0 'src example.com and tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | |
| # 3. To monitor HTTP traffic including request and response headers and message body from local host to local host: | |
| tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -i lo |
This file contains hidden or 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
| /* | |
| * get column number by column name | |
| */ | |
| function testGetColumnNrByName() { | |
| var sheet = SpreadsheetApp.getActiveSheet(); | |
| Logger.log(getColumnNrByName_(sheet, '%COLUM_TITLE%')); | |
| } | |
| function getColumnNrByName(sheet, name) { |
This file contains hidden or 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
| import java.io.ByteArrayOutputStream; | |
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| /** | |
| * Base64编码工具类 | |
| * | |
| */ | |
| public class Base64 { | |
| private static final char[] legalChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray(); |