Skip to content

Instantly share code, notes, and snippets.

View drakmail's full-sized avatar
🇦🇷
Working

Alex Maslov drakmail

🇦🇷
Working
View GitHub Profile
[pid: 11659|app: 0|req: 39822/77306] 62.176.21.105 () {46 vars in 1615 bytes} [Sat Aug 25 00:58:56 2012] GET /notifications/count/ => generated 1 bytes in 390 msecs (HTTP/1.1 200) 3 headers in 112 bytes (1 switches on core 0)
[pid: 11659|app: 0|req: 39823/77307] 62.176.21.105 () {46 vars in 1615 bytes} [Sat Aug 25 00:59:01 2012] GET /notifications/count/ => generated 1 bytes in 362 msecs (HTTP/1.1 200) 3 headers in 112 bytes (1 switches on core 0)
[pid: 11660|app: 0|req: 37485/77308] 93.186.224.104 () {36 vars in 596 bytes} [Sat Aug 25 00:59:02 2012] GET /news/ugly_vk/ => generated 2367 bytes in 5 msecs (HTTP/1.1 200) 2 headers in 94 bytes (242 switches on core 0)
[pid: 11659|app: 0|req: 39824/77309] 62.176.21.105 () {46 vars in 1615 bytes} [Sat Aug 25 00:59:07 2012] GET /notifications/count/ => generated 1 bytes in 378 msecs (HTTP/1.1 200) 3 headers in 112 bytes (1 switches on core 0)
[pid: 11659|app: 0|req: 39825/77310] 62.176.21.105 () {46 vars in 1615 bytes} [Sat Aug 25 00:59:12 2012] GET /notifications/c
#!/bin/bash
PROGRAM1="motion"
APPCHK=$(ps aux | grep -c $PROGRAM1)
if [ $APPCHK = '1' ]; then
echo "OFFLINE"
else
echo "ONLINE"
fi
#!/bin/sh
curl $1 2>/dev/null | grep $2 > /dev/null
if [ "$?" -ne "0" ]; then
echo "fail"
else
echo "ok"
fi
#!/bin/sh
LOGIN=dfsaf
PASSWORD=fsdafdsf
# Save cookie
curl -d "login=$LOGIN&password=$PASSWORD" -c /tmp/rialcom.cookie http://stat.rialcom.ru/
# Load page
curl -s -b /tmp/rialcom.cookie http://stat.rialcom.ru/ > /tmp/rialcom.page
IMAGE=http://rikudou.ru/news/noblesse_234/2012-05-03-2297; mkdir -p images;cd images; wget `curl $IMAGE | sed -n '/alt2/,/\/center/p' | grep img | sed -rn 's/.*src="http:\/\/(.*)".*>/http:\/\/\1/p' | sed 's/".*//g' | sed ':a;N;$!ba;s/\n/\t/g'`;cd ..
@drakmail
drakmail / Holy Grail Layout solved.html
Created April 26, 2012 18:48 — forked from futuraprime/Holy Grail Layout: solved
A minimal solution to the "Holy Grail" CSS layout
<!DOCTYPE html>
<html>
<head>
<title>The Holy Grail - 3 Column CSS layout</title>
<style type="text/css" media="screen">
/* #content is the bounding box. It must have position: relative to anchor it for the background
* columns, and it must have overflow: hidden so it expands to contain floated content within it
* (you could also use a clear div below the columns, if you want to avoid hiding the overflow) */
#content { width:960px; overflow: hidden; position: relative; zoom: 1;}
@drakmail
drakmail / gen.sh
Created March 3, 2012 07:47
Generate random data table with string and int PK
#!/bin/sh
echo " CREATE TABLE myTable ("
echo ' `address` varchar(255) default NULL,'
echo ' `city` varchar(50) default NULL,'
echo ' PRIMARY KEY (`address`)'
echo ' ) ENGINE=MyISAM;'
echo '';
<html>
<head>
<meta http-equiv=content-type content="text/html; charset=utf-8">
<style type="text/css">
html,body{
margin:0;
padding:0
}
#! /bin/sh
### BEGIN INIT INFO
# Provides: beep
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: Beeps that indicate startup and shutdown
### END INIT INFO
#!/usr/bin/python
# VRMS for AgiliaLinux
import sqlite3
db = sqlite3.connect('/var/mpkg/packages.db')
tag = db.execute("SELECT * FROM tags WHERE tags_name='proprietary'")
tagid = list(tag)[0][0]
links = db.execute("SELECT * FROM tags_links WHERE tags_tag_id='{0}'".format(tagid))
total = list(db.execute("SELECT Count(*) FROM packages WHERE package_installed='1'"))[0][0]
prop = []
for item in links: