sysctl -a | grep swap
$ sudo pkill -HUP -u _windowserver
| #!/bin/env python | |
| # Requires: youtube_dl module | |
| # Requires: ffmpeg | |
| # Usage: | |
| # | |
| # python youtube2mp3.py <URL>, ... | |
| # | |
| # Example: | |
| # | |
| # python youtube2mp3.py https://www.youtube.com/watch?v=dQw4w9WgXcQ |
| // run a command using the shell; no need to split args | |
| // from https://stackoverflow.com/questions/6182369/exec-a-shell-command-in-go | |
| func runcmd(cmd string, shell bool) []byte { | |
| if shell { | |
| out, err := exec.Command("bash", "-c", cmd).Output() | |
| if err != nil { | |
| log.Fatal(err) | |
| panic("some error found") | |
| } | |
| return out |
Free O'Reilly books and convenient script to just download them.
Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post
How to use:
download.sh file and put it into a directory where you want the files to be saved.cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.| bash -c 'while [[ "$(curl -s localhost:9000/api/system/status | jq --raw-output ''.status'')" != "UP" ]]; do sleep 5; done' | |
| # also check https://gist.github.com/rgl/f90ff293d56dbb0a1e0f7e7e89a81f42 |
| bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done' | |
| # also check https://gist.github.com/rgl/c2ba64b7e2a5a04d1eb65983995dce76 |
The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.
It uses Open Source tools that are widely available, tested and understood:
This is the source for the scripts discussed in https://robots.thoughtbot.com/improving-user-experience-with-shell-scripts
Both scripts are in the bin/ directory of the repo that contains all the markdown documents for blog posts.
Users run bin/server and everything is automatically set up for them to view a local preview of the blog.
bin/server-setup is a dependency of bin/server and is never run directly by users.
Maitre-d is the name of the "blog engine" discussed in the article.
| #! /bin/bash | |
| # Replace "/path/to/gsutil/" with the path of your gsutil installation. | |
| PATH="$PATH":/path/to/gsutil/ | |
| # Replace "/home/username/" with the path of your home directory in Linux/Mac. | |
| # The ".boto" file contains the settings that helps you connect to Google Cloud Storage. | |
| export BOTO_CONFIG="/home/username/.boto" | |
| # A simple gsutil command that returns a list of files/folders in your bucket. |