- */etc/nginx/*に移動する
- 出力先のディレクトリオーナーがrootになっているので
tee
コマンドを使ってリダイレクトする
$ cd /etc/nginx/
$ print "USER:$(openssl passwd -crypt PASSWORD)\n" | sudo tee .htpasswd
- .confファイルに.htpasswdへのパスを指定
javascript: | |
(function(){ | |
var l=location.href; | |
l=prompt('URL',l); | |
var u='http://megalodon.jp/?url='+escape(l); | |
with(window.open().document){ | |
location.href=u; | |
close(); | |
} | |
} |
#!/bin/bash | |
# limit plex media server cpu usage, especially plex transcoder | |
# on os x (works on el capitan) | |
# | |
# prerequisite: install cpulimit | |
# brew install cpulimit | |
# | |
# arguments: | |
# -l 100 limits plex cpu usage to around 30-40 % on a mac mini | |
# running lots of other processen |
#!/bin/bash | |
# ============================================================== | |
# CPU limit daemon - set PID's max. percentage CPU consumptions | |
# ============================================================== | |
# Variables | |
CPU_LIMIT=20 # Maximum percentage CPU consumption by each PID | |
DAEMON_INTERVAL=3 # Daemon check interval in seconds | |
BLACK_PROCESSES_LIST= # Limit only processes defined in this variable. If variable is empty (default) all violating processes are limited. | |
WHITE_PROCESSES_LIST= # Limit all processes except processes defined in this variable. If variable is empty (default) all violating processes are limited. |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "private_network", ip: "192.168.100.100" | |
config.vm.synced_folder "./www", "/var/www/", :nfs => { :mount_options => ["dmode=777","fmode=666"] } |
#!/bin/sh | |
# Flacon-style convert to mp3 and split tracks from flac+cue files | |
# Made by André Rendeiro (afrendeiro@gmail.com) | |
# Rename | |
{ | |
find . -name '* *' | while read file; do target=`echo "$file" | sed 's/ /_/g'`; mv "$file" "$target"; done | |
find . -name '* *' | while read file; do target=`echo "$file" | sed 's/ /_/g'`; mv "$file" "$target"; done | |
find . -name '* *' | while read file; do target=`echo "$file" | sed 's/ /_/g'`; mv "$file" "$target"; done |
# -*- coding:utf-8 -*- | |
from selenium import webdriver | |
user_agent = ( | |
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) " + | |
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36" | |
) | |
sourcedir = "/tmp" | |
sourcefiles = ["subfile1.srt", "subfile2.srt"] |
tee
コマンドを使ってリダイレクトする$ cd /etc/nginx/
$ print "USER:$(openssl passwd -crypt PASSWORD)\n" | sudo tee .htpasswd
# -*- encoding: utf-8 -*- | |
import sys | |
import os.path | |
import codecs | |
if len(sys.argv) == 1: | |
print "Usage: cue_to_mp3.py <CUE file path> [-o]" | |
print "Options:" | |
print " -o, execute and output mp3 file" |
The previous Tigervnc versions had a wrapper script called vncserver
which
could be run as a user manually to start Xvnc process. The usage was quite
simple as you just run
$ vncserver :x [vncserver options] [Xvnc options]
and that was it. While this was working just fine, there were issues when users wanted to start a Tigervnc server using systemd. For these reasons things were completely changed and there is now a new way how this all is supposed to work.
#!/bin/sh | |
# | |
# Script to start CPU limit daemon | |
# | |
set -e | |
case "$1" in | |
start) | |
if [ $(ps -eo pid,args | gawk '$3=="/usr/bin/cpulimit_daemon.sh" {print $1}' | wc -l) -eq 0 ]; then | |
nohup /usr/bin/cpulimit_daemon.sh >/dev/null 2>&1 & |