A collection of commands that change the Arc Browser icon on macOS.
| Theme | Command |
|---|---|
| Candy Arc | defaults write company.thebrowser.Browser currentAppIconName candy |
| var db = connect(url); | |
| var dbName = db.getName(); | |
| print(`Database: ${dbName}`); | |
| var collections = db.getCollectionNames() | |
| collections.forEach((table)=>{ | |
| var commands = []; | |
| var indexes = db[table].getIndexes(); |
This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.
http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL
| http { | |
| log_format bodylog '$remote_addr - $remote_user [$time_local] ' | |
| '"$request" $status $body_bytes_sent ' | |
| '"$http_referer" "$http_user_agent" $request_time ' | |
| '<"$request_body" >"$resp_body"'; | |
| lua_need_request_body on; | |
| set $resp_body ""; | |
| body_filter_by_lua ' |
| sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo | |
| sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo | |
| sudo yum install -y apache-maven | |
| mvn --version |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)| type ( | |
| // BuoyCondition contains information for an individual station. | |
| BuoyCondition struct { | |
| WindSpeed float64 `bson:"wind_speed_milehour"` | |
| WindDirection int `bson:"wind_direction_degnorth"` | |
| WindGust float64 `bson:"gust_wind_speed_milehour"` | |
| } | |
| // BuoyLocation contains the buoy's location. | |
| BuoyLocation struct { |
WARNING: If you're reading this in 2021 or later, you're likely better served by reading:
(This gist was created in 2013 and targeted the legacy GOPATH mode.)
$ ssh -A vm
$ git config --global url."[email protected]:".insteadOf "https://github.com/"| #!/usr/bin/python | |
| # | |
| # LICENSE: MIT | |
| # | |
| # Copyright (C) 2014 Samuel Stauffer | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to | |
| # deal in the Software without restriction, including without limitation |