list the directories in the current directory
ls -d */
get or set kernel state
sysctl
TCP window scale option
sysctl net.inet.tcp.rfc1323
shows date in historyfile
export HISTTIMEFORMAT="%h/%d - %H:%M:%S "
show wan-ip
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
# From https://github.com/WilliamHackmore/linuxgems | |
# cheat_sheet.org | |
# (C) William Hackmore, 2010 | |
# The contents of this file are released under the GNU General Public License. Feel free to reuse the contents of this work, as long as the resultant works give proper attribution and are made publicly available under the GNU General Public License. | |
# Last updated 8/14/2012 | |
# Best viewed in emacs org-mode. | |
* Command Reference: | |
** Basics: | |
*** Getting help: |
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/sh | |
host=localhost:9200 | |
curl -X DELETE "${host}/test" | |
curl -X PUT "${host}/test" -d '{ | |
"settings" : { "index" : { "number_of_shards" : 1, "number_of_replicas" : 0 }} | |
}' |
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
{ | |
"name": "re-index", | |
"version": "0.0.1", | |
"description": "Create backup, and re-index elastic search data with scan and scroll", | |
"main": "re-index.coffee", | |
"author": "Chaitanya Surapaneni", | |
"license": "MIT", | |
"dependencies": { | |
"request": "~2.21.0", | |
"async": "~0.2.8", |
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
{ | |
"query": { | |
"custom_filters_score": { | |
"query": { | |
"filtered": { | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"field": { |
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
@loop: (method, data, callback) -> | |
results = [] | |
data.pageNumber ?= 1 | |
@[method] data, (err, res) => | |
# totalResults = res?.totalNumberOfElements | |
# numberOfElements = res?.numberOfElements | |
totalPages = parseInt(res[0]?.result?.totalPages) | |
results.push res[0]?.result?.resultSet | |
async.whilst -> | |
return data.pageNumber isnt totalPages |
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
request = require 'request' | |
async = require 'async' | |
url = "http://letsrevolutionizetesting.com/challenge.json" | |
id = null | |
message = null | |
async.whilst -> | |
not message? | |
, (callback) -> | |
oUurl = url |
A curated list of amazingly awesome PHP libraries, resources and shiny things.
- Composer/Packagist - A package and dependency manager.
- Composer Installers - A multi framework Composer library installer.
I agree the point you’re making here, 100%. However, a slight correction about Node’s APIs.
First of all, process.nextTick is actually first in, first out. Proof:
$ node -e 'process.nextTick(console.log.bind(console, 1)); process.nextTick(console.log.bind(console, 2))'
1
2
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
var Article = require('../../../models/article');
Those suck for maintenance and they're ugly.
OlderNewer