Skip to content

Instantly share code, notes, and snippets.

View jhgjhtuytdfbnfvmnbgjtuydt's full-sized avatar
💭
🧬🧬🧬🧬🧬🧬🧬🧬🧬🧬 🖤🧬🧬

jhgjhtuytdfbnfvmnbgjtuydt

💭
🧬🧬🧬🧬🧬🧬🧬🧬🧬🧬 🖤🧬🧬
View GitHub Profile
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'
@jhgjhtuytdfbnfvmnbgjtuydt
jhgjhtuytdfbnfvmnbgjtuydt / Code cheat sheet.md
Created December 18, 2018 11:23 — forked from fmaylinch/Code cheat sheet.md
Common lines of code in different languages for quick reference and comparison

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.
# 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|
@jhgjhtuytdfbnfvmnbgjtuydt
jhgjhtuytdfbnfvmnbgjtuydt / remove_postgres_on_mac_os.md
Created December 14, 2017 20:28 — forked from Atlas7/remove_postgres_on_mac_os.md
Note - How completely uninstall PostgreSQL 9.X on Mac OSX

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.
@jhgjhtuytdfbnfvmnbgjtuydt
jhgjhtuytdfbnfvmnbgjtuydt / remove_postgres_on_mac_os.md
Created December 14, 2017 20:28 — forked from Atlas7/remove_postgres_on_mac_os.md
Note - How completely uninstall PostgreSQL 9.X on Mac OSX

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.
@jhgjhtuytdfbnfvmnbgjtuydt
jhgjhtuytdfbnfvmnbgjtuydt / usage.md
Created November 25, 2017 16:20 — forked from coderofsalvation/usage.md
xclip for mac & linux & vim

In action

$ cat ~/projects/foo/somefile.js | xclip
(paste into browser)

$ cat ~/projects/foo/somefile.js | xclipmd
(paste into markdowncompatible website like slackchat etc)

@jhgjhtuytdfbnfvmnbgjtuydt
jhgjhtuytdfbnfvmnbgjtuydt / nginx-naxsi.sh
Created November 10, 2017 01:04 — forked from dcnl1980/nginx-naxsi.sh
Nginx Naxsi (firewall) on Ubuntu 16.04
#!/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)
@jhgjhtuytdfbnfvmnbgjtuydt
jhgjhtuytdfbnfvmnbgjtuydt / kibana.json
Created November 3, 2017 02:21 — forked from pblittle/kibana.json
Kibana indexes generated by Logsearch for Cloud Foundry (https://github.com/logsearch/logsearch-for-cloudfoundry)
{"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
{
"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,