This file contains hidden or 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
KDIR ?= /lib/modules/$(shell uname -r) | |
SDIR ?= $(KDIR)/source | |
CLANG ?= clang | |
LLC ?= llc | |
#ARCH := $(subst x86_64,x86,$(shell arch)) | |
ARCH := x86 | |
BIN := modify-ping-ttl.o | |
CLANG_FLAGS = -I. -I$(SDIR)/arch/$(ARCH)/include \ | |
-I$(SDIR)/arch/$(ARCH)/include/generated \ |
This file contains hidden or 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
# Remove deleted or moved files from `svn`: | |
svn status --ignore-externals | grep ! | tr -s ' ' | cut -d ' ' -f2 | xargs svn rm | |
# Get contents of file from line 5 to line 13: | |
sed -n -e 5,13p [FILE] | |
# Find all .php files and search/replace string | |
find -name "*.php" -not -path ".svn" -print | xargs grep -l "require_lib( 'old' )" | xargs -I X sed -i -e "s|require_lib( 'old' )|require_lib( 'new' )|g" X | |
# Execute a command in every folder in current directory | |
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd {} && pwd" \; | |
# OpenWRT cron for switching changing LED color if pinging 8.8.8.8 fails | |
ping -q -c 5 8.8.8.8 && { echo 0 > /sys/devices/platform/gpio-leds/leds/inet:orange/brightness; echo 255 > /sys/devices/platform/gpio-leds/leds/inet:blue/brightness; } || { echo 255 > /sys/devices/platform/gpio-leds/leds/inet:orange/brightness; echo 0 > /sys/devices/platform/gpio-leds/leds/inet:blue/brightness; } |
This file contains hidden or 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
#!/bin/bash | |
echo "This script copies SugarCRM translation files for given language code from current directory to destination directory" | |
echo "" | |
echo "Enter language code:" | |
read language | |
echo "Enter destination directory:" | |
read destination_dir | |
rsync -uavm --include="*/" --include="*$language*" --exclude="*" . $destination_dir/$language |
This file contains hidden or 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
#!/bin/bash | |
current_wifi=`nmcli dev wifi | grep yes | cut -d\' -f2`; | |
home_wifi="{HOME_SSID}"; | |
if [ "$current_wifi" == "$home_wifi" ]; then | |
wget -O - http://freedns.afraid.org/dynamic/update.php?{KEY} >> /tmp/freedns.afraid.org.log 2>&1 & | |
fi |
This file contains hidden or 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
# SSD | |
UUID=16aba771-3dca-4855-8678-7556fbc87fe1 / ext4 discard,noatime,errors=remount-ro 0 1 | |
# swap | |
UUID=68de305b-931e-497a-ae96-2504ec4e161b none swap sw 0 0 | |
# /tmp /var/tmp on RAM | |
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0 | |
tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0 | |
# /var/log on HDD | |
UUID=73d1b2d3-8a9b-4a78-8418-01a46d85e226 /var/log ext4 defaults,noatime 0 2 | |
# /var/www on HDD |
This file contains hidden or 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
{ | |
"require": { | |
"predis/predis": "dev-master" | |
} | |
} |
This file contains hidden or 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
<?php | |
$text = '₩'; | |
$fromEncoding = 'UTF-8'; | |
$toEncoding = 'EUC-KR'; | |
echo iconv($toEncoding, $fromEncoding, iconv($fromEncoding, $toEncoding, $text)); | |
echo "\n"; | |
echo mb_convert_encoding(mb_convert_encoding($text, $toEncoding, $fromEncoding), $fromEncoding, $toEncoding); | |
echo "\n"; |
This file contains hidden or 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
[backup] | |
access_token: {token} | |
from_dir: {from_dir} | |
to_dir: {to_dir} | |
file_types: {file_types} |
This file contains hidden or 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
<?php | |
$_sessionId = null; | |
$_sc = new SoapClient( | |
null, | |
array( | |
'location' =>'http://127.0.0.1/6_5_x/ent/sugarcrm/soap.php', | |
'uri' => 'http://www.sugarcrm.com/sugarcrm', | |
'trace' => true, |
This file contains hidden or 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
<?php | |
$method = 'login'; | |
$parameters = array('user_auth' => array('user_name' => 'admin', 'password' => md5('admin'))); | |
$response = makeRESTCall($method, $parameters); | |
$session = $response['id']; | |
$method = 'get_relationships'; | |
$relationship = 'email_addresses'; | |
$module = 'Accounts'; |
NewerOlder