Skip to content

Instantly share code, notes, and snippets.

View xlab's full-sized avatar
:octocat:
Hacking

Max Kupriianov xlab

:octocat:
Hacking
View GitHub Profile
[root@sv|~] cat /etc/lighttpd/conf-enabled/10-fastcgi.conf
# /usr/share/doc/lighttpd-doc/fastcgi.txt.gz
# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions#mod_fastcgi-fastcgi
server.modules += ( "mod_fastcgi" )
fastcgi.server = ( ".php" => ((
"bin-path" => "/usr/bin/php5-cgi",
"socket" => "/tmp/php.socket",
"max-procs" => 1,
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
@xlab
xlab / mult.php
Created December 17, 2011 15:50
Multiply table
<?foreach(range(1,10) as $i){foreach(range(1,10) as $j){print ($i*$j).($j%10?" ":"\n");}}?>
можешь быстро накатать программу для вывода таблице умножения:вот прмиерно такую искинуть код
От mendab1e руби:
(1..10).each{|y| p (1..10).map{|x| x*y}}
//по мотивам http://cl.ly/Chfa
@xlab
xlab / BallScene.cs
Created March 3, 2012 19:07
CocosNET (cocos2d port) + Monotouch, my first app
using System;
using CocosNet.Layers;
using CocosNet.Labels;
using System.Drawing;
using CocosNet;
using CocosNet.Menus;
using MonoTouch.UIKit;
using CocosNet.Support;
using CocosNet.Sprites;
using CocosNet.Actions;
@xlab
xlab / lock.c
Created July 13, 2012 10:59
Touchscreen lock via tslib
#include "tslib/src/tslib.h"
struct tsdev *ts;
char *tsdevice = "/dev/input/event0";
ts = ts_open(tsdevice, 0);
int ts_tmpfd = ts_fd(ts);
if (ts_tmpfd == -1)
{
perror("ts_open");
@xlab
xlab / sources.list
Created July 13, 2012 11:09
Maemo4 repositories
deb http://repository.maemo.org maemo4.1.2/tools free non-free
deb http://repository.maemo.org maemo4.1.2/sdk free non-free
deb http://qt4.garage.maemo.org diablo user extras
deb http://repository.maemo.org/extras/ diablo free non-free
deb http://repository.maemo.org/extras-devel/ diablo free non-free
deb http://qole.org/repository maemo main
deb http://n8xx.com/debs/ diablo free
deb http://repository.maemo.org diablo free non-free
@xlab
xlab / matchbox-keyboard-toggler.c
Created July 13, 2012 11:16
Matchbox Keyboard Toggler
/*
A very simple program to send the toggle-keyboard event to matchbox-keyboard
Requires a version of matchbox-keyboard running in daemon mode (-d), and
must be a version of matchbox-keyboard that supports the toggle event.
Currently the SVN version meets this requirement.
Compiling:
gcc matchbox-keyboard-toggler.c -o matchbox-keyboard-toggler -lX11
@xlab
xlab / profile.sh
Created July 13, 2012 14:24
Nokia N810 .profile
#!/bin/sh
cd ~
export HISTCONTROL=ignoredups
shopt -s checkwinsize
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
@xlab
xlab / mka.py
Created July 26, 2012 13:49
Matchbox keyboard applet, PyGTK
#! /usr/bin/env python
# -*- coding: UTF-8 -*-
# Matchbox-keyboard Applet
# (C) 2009 Maxim Kouprianov <http://kc.vc>
import pygtk
pygtk.require('2.0')
import gtk
import os
@xlab
xlab / matchbox-window-manager-matan.diff
Created July 26, 2012 13:56
Enable movable dialogs (DIALOGMODE=free) in 'matchbox-window-manager'
diff -ur orig/matchbox-window-manager-1.2/src/dialog_client.c matchbox-window-manager-1.2/src/dialog_client.c
--- orig/matchbox-window-manager-1.2/src/dialog_client.c 2007-08-16 08:51:54.000000000 +0300
+++ matchbox-window-manager-1.2/src/dialog_client.c 2008-10-13 13:12:02.000000000 +0200
@@ -667,8 +667,8 @@
int bdr_south = 0, bdr_west = 0, bdr_east = 0, bdr_north = 0;
/* Check if we actually want to perform any sizing intervention */
- if (w->config->dialog_stratergy == WM_DIALOGS_STRATERGY_FREE)
- return;
+// if (w->config->dialog_stratergy == WM_DIALOGS_STRATERGY_FREE)