Skip to content

Instantly share code, notes, and snippets.

View drakmail's full-sized avatar
🇦🇷
Working

Alex Maslov drakmail

🇦🇷
Working
View GitHub Profile
@drakmail
drakmail / main.php
Created December 11, 2011 16:50
Авторизация в toodle
<?php
use toodle\core\BasicController;
/**
* Controller for main part
*/
class MainController extends BasicController
{
/**
* @var $logged string Does user logged in?
*/
#!/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:
#! /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
<html>
<head>
<meta http-equiv=content-type content="text/html; charset=utf-8">
<style type="text/css">
html,body{
margin:0;
padding:0
}
@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 '';
@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;}
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 ..
#!/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
#!/bin/sh
curl $1 2>/dev/null | grep $2 > /dev/null
if [ "$?" -ne "0" ]; then
echo "fail"
else
echo "ok"
fi
#!/bin/bash
PROGRAM1="motion"
APPCHK=$(ps aux | grep -c $PROGRAM1)
if [ $APPCHK = '1' ]; then
echo "OFFLINE"
else
echo "ONLINE"
fi