Skip to content

Instantly share code, notes, and snippets.

View Snawoot's full-sized avatar

Snawoot

  • Odessa, Ukraine
View GitHub Profile
location / {
try_files $uri $uri/ @rewr;
}
location @rewr {
rewrite ^([\w\d]+)/?$ /index.php?module=$1 break;
rewrite ^([\w\d]+)/([^/]+)/?$ index.php?module=$1&do=$2 break;
rewrite ^([\w\d]+)/([^/]+)/([^/]+)/?$ index.php?module=$1&do=$2&type=$3 break;
}
#!/bin/sh
## не имеет большого смысла. классический шелл (или что его в системе заменяет не даёт никакой существенной экономии, только лишь проёбы производительности из-за того что в баше большинство важных команд являются встроенными, а в шелле - нет)
#cleanup 2
#Root needed
LOG_DIR=/var/log
ROOT_UID=0 # Only root had $UID 0
LINES=50 # Number of strings we save
E_XCD=66 # We cannot enter to the dir?
E_NOTROOT=67 # Not a root
while getopts ":c::i::f::m::e::t::w:h" opt; do
case $opt in
f) FILE="$OPTARG" ;;
m) MSG="$OPTARG" ;;
e) EXIT="$OPTARG" ;;
t) TYPE="$OPTARG" ;;
w) ERR_LIMIT_W="$OPTARG" ;;
c) ERR_LIMIT_C="$OPTARG" ;;
i) INTERVAL="$OPTARG" ;;
h) usage; exit 0 ;;
following order of precedence:
exact name
longest wildcard name starting with an asterisk, e.g. “*.example.org”
longest wildcard name ending with an asterisk, e.g. “mail.*”
first matching regular expression (in order of appearance in a configuration file)
--- tarantool-1.4.8+64+gcf66a7b+20130314+2251.orig/test/unit/objc_catchcxx.m
+++ tarantool-1.4.8+64+gcf66a7b+20130314+2251/test/unit/objc_catchcxx.m
@@ -8,7 +8,7 @@ int main()
luaL_openlibs(L);
@try {
luaL_error(L, "test");
- } @catch (...) {
+ } @catch (id allOthers) {
printf("exception handled\n");
}
30 3 * * * ionice -c3 nice -n 10 /usr/local/bin/upload-backup
0 3 * * * nice -n 10 /usr/local/bin/davclean.py
0 4 * * * ionice -c3 find /home/backup -type f -mtime +30 -delete
0 5 * * * ionice -c3 nice -n 10 /usr/bin/python -W ignore::DeprecationWarning /usr/bin/rdiff-backup /home/user/www/files/ 10.10.1.2::/rdiffbackup/upload/
0 */2 * * * kill -USR1 `pidof tarantool_box`
root@server:~# for i in {1..8} ; do dd if=/dev/zero of=disk$i bs=8M count=1 ; do ne
1+0 записей считано
1+0 записей написано
скопировано 8388608 байт (8,4 MB), 0,030612 c, 274 MB/c
1+0 записей считано
1+0 записей написано
скопировано 8388608 байт (8,4 MB), 0,043387 c, 193 MB/c
1+0 записей считано
1+0 записей написано
скопировано 8388608 байт (8,4 MB), 0,0478381 c, 175 MB/c
#!/usr/bin/python
my_dict = {
'key1': 'value1',
'key2': 0,
'key3': 'value3'
}
print my_dict
v.yarmak@v-yarmak:~$ sudo -s
[sudo] password for v.yarmak:
root@v-yarmak:/home/vlad# apt-get install apt-file
Чтение списков пакетов… Готово
Построение дерева зависимостей
Чтение информации о состоянии… Готово
Уже установлена самая новая версия apt-file.
обновлено 0, установлено 0 новых пакетов, для удаления отмечено 0 пакетов, и 4 пакетов не обновлено.
root@v-yarmak:/home/vlad# apt-file update
Downloading Index http://mirror.yandex.ru/debian/dists/wheezy/main/Contents-amd64.diff/Index:
def checkio(data):
#Your code here
#It's main function. Don't remove this function
#It's using for auto-testing and must return a result for check.
#replace this for solution
sorted_pairs = sorted(enumerate(data),None,lambda (index, element): element)
count = len(data)
if count == 1:
return []