DST=/mnt
find /var/lib -type f -size +1G -exec ls -lh {} \; | tee $DST/bigfiles_var_lib_$(date "+%H%M").log
find /var/lib -type f -size +1G -exec ls -lh {} \; | awk '{ print $5 ": " $9 }' | sort -rh > $DST/bigfiles_var_lib_$(date "+%H%M").sorted.log
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
Mute these words in your settings here: https://twitter.com/settings/muted_keywords | |
ActivityTweet | |
generic_activity_highlights | |
generic_activity_momentsbreaking | |
RankedOrganicTweet | |
suggest_activity | |
suggest_activity_feed | |
suggest_activity_highlights | |
suggest_activity_tweet |
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
# send logs for all traffic (including non-html) to google analytics | |
# | |
# in server block: | |
# set $google_analytics_id "UA-THECORRECT-ID"; | |
# include /srv/nginx/google_analytics; | |
# | |
# in location blocks: | |
# post_action @ga; | |
# | |
# notes: post_action has been referred to by nginx devs as a "dirty hack" and this approach may stop working one day. |
Let's say we can a blog hosted as Wordpress.com but visible on our custom domain in subpath due to SEO. WordPress.com supports changing domain/subdomain but not path.
We could either make our own installation, change hosting provier or make nginx proxy with URL rewrites.
- WP blog: https://example.wordpress.com/
- Desired site: http://example.com/blog/
This tutorial is inpsired by http://marsbard.github.io/2016-07-30-replace-urls-behind-nginx-reverse-proxy/.
System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go
directory by:
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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"github.com/docker/engine-api/client" | |
"github.com/docker/engine-api/types" | |
"golang.org/x/net/context" | |
) |
$ ./githubapi-get.sh $GITHUBTOKEN /users/mbohun/repos
HTTP/1.1 200 OK
Server: GitHub.com
Date: Wed, 04 Mar 2015 04:30:29 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 155683
Status: 200 OK
Moved to git repository: https://github.com/denji/golang-tls
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
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
package main | |
import ( | |
"net/http" | |
) | |
func main() { | |
go func() { | |
http.ListenAndServe(":8001", &fooHandler{}) | |
}() |