This two launchdaemon scripts provide scheduled updates and upgrade for homebrew packages.
It will run in the following way:
brew updateevery day at 12:10brew upgradeevery day at 12:20
| #!/bin/bash | |
| # Script for installing tmux on systems where you don't have root access. | |
| # tmux will be installed in $HOME/local/bin. | |
| # It's assumed that wget and a C/C++ compiler are installed. | |
| # exit on error | |
| set -e | |
| TMUX_VERSION=1.8 |
| #/usr/bin/env python | |
| from pandas import np | |
| from pandas.io.data import DataReader | |
| def historical_volatility(sym, days): | |
| "Return the annualized stddev of daily log returns of `sym`." | |
| try: | |
| quotes = DataReader(sym, 'yahoo')['Close'][-days:] |
| #include <Adafruit_NeoPixel.h> | |
| #define PIN 1 | |
| #define STRIPSIZE 16 | |
| // Parameter 1 = number of pixels in strip | |
| // Parameter 2 = pin number (most are valid) | |
| // Parameter 3 = pixel type flags, add together as needed: | |
| // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) | |
| // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) |
| #Insall Ajenti | |
| apt-get update | |
| wget http://repo.ajenti.org/debian/key -O- | apt-key add - | |
| echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list | |
| apt-get update | |
| apt-get install ajenti | |
| service ajenti restart | |
| # Uninstall Apache2 | |
| sudo apt-get autoremove && sudo apt-get remove apache2* |
| #!/usr/bin/env python | |
| """Test functions from | |
| http://stackoverflow.com/questions/28680896/how-can-i-get-the-3rd-friday-of-a-month-in-python | |
| """ | |
| import calendar | |
| from datetime import date, datetime, time, timedelta | |
| from itertools import islice | |
| DAY = timedelta(1) |
| import logging | |
| from StringIO import StringIO as StringBuffer | |
| logger = logging.getLogger('basic_logger') | |
| logger.setLevel(logging.DEBUG) | |
| ### Setup the console handler with a StringIO object | |
| log_capture_string = StringBuffer() | |
| # log_capture_string.encoding = 'cp1251' | |
| ch = logging.StreamHandler(log_capture_string) |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| server_name example.com www.example.com subsite.com www.subsite.com another.com www.another.com; | |
| return 301 https://$host$request_uri; | |
| } | |
| server { | |
| listen 443 ssl http2; | |
| listen [::]:443 ssl http2; |
Closing the terminal will kill all processes launched from its shell instance that are still running. Here is how to detach a running process and run+detach a new process:
Scenario 1:
Let’s say we have ./long.sh running, and we want to detach it:
./long.sh| remove your ~/.toprc (if any) | |
| start "top" | |
| press z | |
| press V | |
| press 1 | |
| press y | |
| press m m | |
| press t t t | |
| press W |