Skip to content

Instantly share code, notes, and snippets.

View Snawoot's full-sized avatar

Snawoot

  • Odessa, Ukraine
View GitHub Profile
vlad@blastfurnace:~$ cat ex1.py
#!/usr/bin/python
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)
root@blastfurnace:/home/vlad# lsmod | grep nf
binfmt_misc 12957 1
nfsd 216170 2
nfs 308313 0
nfs_acl 12511 2 nfs,nfsd
auth_rpcgss 37143 2 nfs,nfsd
fscache 36739 1 nfs
lockd 67306 2 nfs,nfsd
sunrpc 173730 6 lockd,auth_rpcgss,nfs_acl,nfs,nfsd
root@blastfurnace:/home/vlad# iptables -L -t nat
#include <stdio.h>
#define MAXLINE 1000 /* max size of input string */
char rev[MAXLINE];
int getlline(char [], int);
void copy(char [], char []);
char* reverse(char []);
v.yarmak@v-yarmak:~$ wget -S --spider http://www.startravel.ru/common/contacts/index.html
Включен режим робота. Проверка существования удалённого файла.
--2013-07-22 18:24:09-- http://www.startravel.ru/common/contacts/index.html
Распознаётся www.startravel.ru (www.startravel.ru)... 46.254.19.27
Подключение к www.startravel.ru (www.startravel.ru)|46.254.19.27|:80... соединение установлено.
HTTP-запрос отправлен. Ожидание ответа...
HTTP/1.1 301 Moved Permanently
Server: nginx/1.2.1
Date: Mon, 22 Jul 2013 14:23:26 GMT
Content-Type: text/html
Cust: What is the command that will tell me
the revision code of a program?
Tech: Yes, that's correct.
Cust: No, what is it?
Tech: Yes.
Cust: Yes?
def checkio(data):
#replace this for solution
return len(data)>=10 and reduce(lambda y, char: True if str.isupper(char) else y, data, False) and reduce(lambda y, char: True if str.isdigit(char) else y, data, False) and reduce(lambda y, char: True if str.islower(char) else y, data, False)
class groupby(object):
# [k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B
# [list(g) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D
def __init__(self, iterable, key=None):
if key is None:
key = lambda x: x
self.keyfunc = key
self.it = iter(iterable)
self.tgtkey = self.currkey = self.currvalue = object()
def __iter__(self):
yarmak@linux-commander:~$ whois turboreferat.ru
% By submitting a query to RIPN's Whois Service
% you agree to abide by the following terms of use:
% http://www.ripn.net/about/servpol.html#3.2 (in Russian)
% http://www.ripn.net/about/en/servpol.html#3.2 (in English).
domain: TURBOREFERAT.RU
nserver: ns1.dynamicmedia.info.
nserver: ns2.dynamicmedia.info.
state: REGISTERED, DELEGATED, VERIFIED
#!/bin/bash
cp geo.conf geo.conf.old
wget -OGeoIPCountryCSV.zip -q http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip
csv_file=`unzip -qq -l GeoIPCountryCSV.zip */GeoLite2-Country-Blocks.csv | awk '{ print $4 }'`
csv_date=`unzip -qq -l GeoIPCountryCSV.zip */GeoLite2-Country-Blocks.csv | awk '{ print $2 }'`
#!/usr/bin/python
import sys
import urllib
import urllib2
import re
url = "http://huifikator.ru/huify_text.php"
values = {