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
select to_timestamp('1970-01-01T00:00:00.000Z', 'YYYY-MM-DD"T"HH24:MI:SS.FFF"Z"') as ts from dual; |
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
CNT=1; ERR=0; while test $ERR -eq 0; do printf "Attempt: %3d at %s\n" $CNT "$(date)"; ssh -o 'VisualHostKey=no' [email protected] /sbin/reboot; ERR=$?; test $ERR -eq 0 && sleep $((2 * 60)); CNT=$CNT+1; done; test $ERR -ne 0 && printf "Failed with code %d at %s" $ERR "$(date)" && paplay /usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga |
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 | |
# Since we're dealing with dd, abort if any errors occur | |
set -e | |
SOURCE_FILE=${1:-/dev/zero} | |
TEST_FILE=${2:-dd_obs_testfile} | |
[ -e "$TEST_FILE" ]; TEST_FILE_EXISTS=$? | |
TEST_FILE_SIZE=${3:-$((128*1024*1024))} # 128Mb |
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
if [ "${0#/*profile*}" != "${0}" ] | |
then | |
BASEDIR=$(dirname "$(readlink -f "$0")") | |
else | |
if [ $# -gt 0 -a "${1#/*profile*}" != "${1}" ] | |
then | |
BASEDIR=$(dirname "$(readlink -f "$1")") | |
else | |
echo 'NOTE: When sourcing this profile on some shells (e.g. Busybox) you need to profile file name twice.' | |
echo 'Usage: . path/to/profile path/to/profile' |
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
// Go to "Administration > Portal Configuration" | |
// Replace donation box at "'About' Column" with: | |
<div style="padding:8px;"><a id="googlesearchlink" href="https://google.com/">Google</a></div> | |
<div style="padding:8px;"><a id="yandexsearchlink" href="https://yandex.ru/">Yandex</a></div> | |
<div style="padding:8px;"><a id="wikisearchlink" href="https://wikipedia.org/">Wikipedia</a></div> | |
<script> | |
function updateSearchLink(elid, hrefPref, captionPref, srch) { | |
var searchlink = document.getElementById(elid); |
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/sh | |
OUT="result" convert source1.tiff source1.tiff ... -depth 75 -units pixelsperinch -compress zip $OUT.pdf && pdf2ps $OUT.pdf && ps2pdf $OUT.ps && rm -f $OUT.ps |
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
\documentclass{article} | |
\usepackage{xltxtra} | |
\usepackage{xecyr} | |
\usepackage{polyglossia} | |
\setmainlanguage{russian} | |
\setotherlanguage{english} | |
\newfontfamily\cyrillicfont{DejaVu Serif} |
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/false | |
## First: select file set. | |
/bin/ls -1 prefix_to_remove_* | |
## Second: test transformation. | |
/bin/ls -1 prefix_to_remove_* | sed 's/^prefix_to_remove_\(.*\)$/\1/' | |
## Third: execute | |
## NOTE: Added 'mv \0 ' to the sed command and '| sh' to the pipe. |
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
#!/bi/sh | |
# Fix dhcp name change. Works for Debian on 2015-07-11. | |
sudo echo "supersede host-name gethostname();" >> /etc/dhcp/dhclient.conf |
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/sh | |
# Sync local date to remote host over ssh | |
ssh remote.host.net sudo date $(date "+%m%d%H%M%Y.%S") |
NewerOlder