Common lines of code in different languages for quick reference and comparison: Java, JavaScript, Kotlin, Objective-C, Python, Ruby, Scala, Swift.
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
| root@LiMe-20094c:~# uci show | |
| alfred.alfred=alfred | |
| alfred.alfred.interface='br-lan' | |
| alfred.alfred.mode='master' | |
| alfred.alfred.batmanif='bat0' | |
| alfred.alfred.start_vis='1' | |
| alfred.alfred.run_facters='1' | |
| batman-adv.bat0=mesh | |
| batman-adv.bat0.bridge_loop_avoidance='1' | |
| batman-adv.bat0.multicast_mode='0' |
The command line, in short…
wget -k -K -E -r -l 10 -p -N -F --restrict-file-names=windows -nH http://website.com/
…and the options explained
- -k : convert links to relative
- -K : keep an original versions of files without the conversions made by wget
- -E : rename html files to .html (if they don’t already have an htm(l) extension)
- -r : recursive… of course we want to make a recursive copy
- -l 10 : the maximum level of recursion. if you have a really big website you may need to put a higher number, but 10 levels should be enough.
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
| # Original from http://snippets.dzone.com/posts/show/4468 by MichaelBoutros | |
| # | |
| # Optimized version which uses to_yaml for content creation and checks | |
| # that models are ActiveRecord::Base models before trying to fetch | |
| # them from database. | |
| namespace :db do | |
| namespace :fixtures do | |
| desc 'Dumps all models into fixtures.' | |
| task :dump => :environment do | |
| models = Dir.glob(RAILS_ROOT + '/app/models/**.rb').map do |s| |
This blog post has helped me clean up my postgres development environment on Mac. So making a copy!
How completely uninstall PostgreSQL 9.X on Mac OSX
This article is referenced from stackoverflow:
If installed PostgreSQL with homebrew , enter brew uninstall postgresql
If you used the EnterpriseDB installer , follow the following step.
This blog post has helped me clean up my postgres development environment on Mac. So making a copy!
How completely uninstall PostgreSQL 9.X on Mac OSX
This article is referenced from stackoverflow:
If installed PostgreSQL with homebrew , enter brew uninstall postgresql
If you used the EnterpriseDB installer , follow the following step.
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 | |
| apt-get install -y libpcre3 libpcre3-dev libssl-dev unzip make \ | |
| libgoogle-perftools-dev google-perftools jq | |
| mkdir /tmp/ngxbuild | |
| cd /tmp/ngxbuild | |
| latestNginx=$(curl -s http://hg.nginx.org/nginx/tags | | |
| grep "^ *release-" | head -1 | cut -c 9-) | |
| latestNaxsi=$(curl -s https://api.github.com/repos/nbs-system/naxsi/releases | | |
| jq -r .[].tag_name | grep -v rc | head -1) |
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
| {"index":{"_index":".kibana","_type":"index-pattern","_id":"[logstash-]YYYY.MM.DD"}} | |
| {"title":"[logstash-]YYYY.MM.DD","timeFieldName":"@timestamp","intervalName":"days","fields":"[{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"@tags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":false},{\"name\":\"@type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":false},{\"name\":\"message\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"@message\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"@timestamp\",\"type\":\"date\",\"count\":0,\"scripte |
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
| { | |
| "checks": { | |
| "sensu-rabbitmq-beam": { | |
| "handlers": [ | |
| "default" | |
| ], | |
| "command": "/etc/sensu/plugins/check-procs.rb -p beam -C 1 -w 4 -c 5", | |
| "interval": 60, | |
| "occurrences": 2, | |
| "refresh": 300, |
NewerOlder