This file contains 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
/** | |
* Букмарклет для хабры (http://habrahabr.ru) | |
* Показывает самого самого в comment'ах топика. | |
* | |
* @author 2bj (dev2bj at gmail) | |
* | |
* @TODO: завернуть в userscripts.org | |
*/ | |
javascript:(function(){try{var d=$("comments").getElements("ul li div ul.positive"),a=[],c;$each(d,function(f,e){a.push([$(f).getElement(".mark span").get("text").toInt(),f])});a.sort(function(f,e){return f[0]-e[0]});c=a.pop();new Fx.Scroll(window).toElement(c[1])}catch(b){}})(); |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Курсо-валют-дёргалко с мега сайта www.nbkr.kg | |
@author 2bj (dev2bj at gmail) | |
@requirements: | |
- urllib | |
- re |
This file contains 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
#!/usr/bin/env bash | |
# bash client for www.hi.kg (URL shorter) | |
# @author 2bj (dev2bj at gmail) | |
# @todo: | |
# - add error exceptions | |
if [ $# -ne 1 ] | |
then | |
echo 'hey, give me URL' |
This file contains 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
#!/usr/bin/env bash | |
# @author: 2bj | |
curl -s myip.yandex.ru | grep "IP: " | sed 's/^ *//g' | sed 's/Ваш IP: //g' |
This file contains 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 | |
# bash implementation of http://www.domain.kg/whois.html | |
# @author 2bj (gml2bj gmail) | |
if [ $# -eq 0 ]; then | |
echo "pls, give me domain (*.kg)" | |
exit 1 | |
fi | |
DOMAIN=`echo $1 | tr '[:lower:]' '[:upper:]'` |
This file contains 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
#!/usr/bin/env bash | |
# bash implementation of pump.kg | |
# @author 2bj (gml2bj gmail) | |
# TODO: | |
# * check download status | |
# * get download url | |
# * add url's from file (bulk add) | |
if [ $# -eq 0 ]; then |
This file contains 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
#!/usr/bin/env python | |
import urllib | |
import re | |
import os | |
# @author 2bj (gml2bj gmail) | |
# @target чиста для себя ;) ну и учу питон | |
class railcasts_grabber: |
This file contains 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
#!/usr/bin/env bash | |
# bash implementation of files.namba.kg | |
# @author 2bj (gml2bj gmail) | |
# @dependens curl, zenity | |
# TODO: | |
# * drag-n-drop (сейчас работает; надо создать лаунчер и дропнуть туда файло) | |
# * progress-bar | |
# * bulk upload (folder) | |
app_name=`basename $0` |
This file contains 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
1. С помощью каких комбинаций клавиш в текстовых редакторах vi или vim скопировать в буфер 4 строки, начиная со строки, где находится курсор? | |
2. Вы в bash запустили команду echo $[5/2]. Какой будет результат? | |
3. В bash вы хотите сравнить два числа. Какой оператор сравнения нужно применить, если нужно узнать, что первое значение больше или равно второму? | |
4. Вам нужно запустить web-сервер Apache на порту 3128. С помощью какой директивы в конфигурационном файле это можно сделать? | |
5. Как в Linux узнать текущий рабочий каталог процесса с pid = 4556? | |
6. Как в Unix посмотреть какие файлы или устройства использует процесс с pid = 85003? | |
7. Какие из перечисленных типов хранилищ в MySQL поддерживают транзакционность: MyISAM, Memory, InnoDB, Archive, NDB, CSV? | |
8. Как в PostgreSQL очистить файлы баз данных от уже удалённых записей? | |
9. Как очистить лог-файл /var/log/log, открытый работающим процессом? | |
10. Вы зашли на сервер с Linux с помощью ssh. Как перегрузить этот сервер по sysrq-b? |
This file contains 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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
OlderNewer