Skip to content

Instantly share code, notes, and snippets.

View unakatsuo's full-sized avatar

Masahiro Fujiwara unakatsuo

View GitHub Profile
@rowan-m
rowan-m / nice-ionice-example.sh
Created May 14, 2012 12:30
Using nice and ionice
#!/bin/bash
# If the process is already running, you can use the following:
PID=`pgrep processname`
renice -n 19 $PID
ionice -c 3 -p $PID
# For new processes, just chain them together
nice -n 19 ionice -c 3 processname
@colrichie
colrichie / parsrc.sh
Last active September 14, 2017 09:00
[MOVED] CSV & JSON & XML file scraping tools
#! /bin/sh
#
# parsrc.sh
# CSV(Excel形式(RFC 4180):ダブルクォーテーションのエスケープは"")から
# 行番号列番号インデックス付き値(line field indexed value)テキストへの正規化
# (例)
# aaa,"b""bb","c
# cc",d d
# "f,f"
# ↓
@sunnyone
sunnyone / PowerShellUICulture.ps1
Created November 15, 2013 15:48
Changing PowerShell UICulture
# example: Set-PowerShellUICulture -Name "en-US"
function Set-PowerShellUICulture {
param([Parameter(Mandatory=$true)]
[string]$Name)
process {
$culture = [System.Globalization.CultureInfo]::CreateSpecificCulture($Name)
$assembly = [System.Reflection.Assembly]::Load("System.Management.Automation")
@voluntas
voluntas / webrtc.rst
Last active June 27, 2024 02:25
WebRTC コトハジメ
@ueokande
ueokande / shell-ip-address
Last active June 18, 2024 18:26
Calculating network addresses in tthe shell script
#!/bin/sh
# converts IPv4 as "A.B.C.D" to integer
# ip4_to_int 192.168.0.1
# => 3232235521
ip4_to_int() {
IFS=. read -r i j k l <<EOF
$1
EOF
echo $(( (i << 24) + (j << 16) + (k << 8) + l ))
for i in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do
echo "userspace" | sudo tee $i;
done
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies
for i in /sys/devices/system/cpu/cpu*/cpufreq/scaling_setspeed; do
echo 2601000 | sudo tee $i;
done