Skip to content

Instantly share code, notes, and snippets.

View pfactum's full-sized avatar

Oleksandr Natalenko pfactum

View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
void *worker(void *data);
struct worker_data_t
{
pthread_t thread_id;
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
void *worker(void *data);
struct worker_data_t
{
pthread_t thread_id;
@pfactum
pfactum / x-wifi-ap-wrapper.sh
Created February 26, 2012 22:33
Wi-Fi wrapper
#!/usr/bin/env bash
delay="1000"
pid1=`pidof hostapd`
if [[ $pid1 != "" ]]
then
notify-send -t $delay "Зупиняю точку доступу Wi-Fi…"
sudo iptables -t nat -F
sudo iptables -t mangle -F
@pfactum
pfactum / flac1.sh
Created March 29, 2012 12:06
flac1
#!/bin/bash
enca -x utf-8 "$1" ; \
shnsplit -o flac "$2" < "$1" && \
rm -f split-track00.flac ; \
cuetag.sh "$1" split*.flac && \
find . -maxdepth 1 -name "split*.flac" -print0 | xargs -0 metaflac --add-replay-gain && \
lltag --yes --no-tagging --rename "%n - %t" split*.flac
@pfactum
pfactum / flac2.sh
Created March 29, 2012 12:07
flac2
#!/bin/bash
#By DsTr wink.gif
#`kdialog --passivepopup "Добавление в коллекцию..." 1`
if [ "$1" == '' ]; then
shellDir="$PWD"
else
shellDir="$1"
fi
diff --git a/Makefile b/Makefile
index ea38990..fafc8d5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 3
-SUBLEVEL = 2
+SUBLEVEL = 3
EXTRAVERSION = -pf
@pfactum
pfactum / minigal-nano-pf.patch
Created July 24, 2012 12:24
MiniGal Nano improvements
diff -Naur MiniGal Nano 0.3.5/config.php mgnew/config.php
--- MiniGal Nano 0.3.5/config.php 2010-12-06 11:43:00.000000000 +0200
+++ mgnew/config.php 2012-07-22 18:34:10.000000000 +0300
@@ -16,28 +16,28 @@
*/
// EDIT SETTINGS BELOW TO CUSTOMIZE YOUR GALLERY
-$thumbs_pr_page = "28"; //Number of thumbnails on a single page
-$gallery_width = "900px"; //Gallery width. Eg: "500px" or "70%"
+$thumbs_pr_page = "21"; //Number of thumbnails on a single page
@pfactum
pfactum / wordpress-pf.patch
Created July 24, 2012 12:26
WordPress user restrictions
--- user-edit.php~ 2012-07-24 14:23:21.000000000 +0300
+++ user-edit.php 2012-07-24 14:50:01.000000000 +0300
@@ -278,52 +278,74 @@
<tr>
<th><label for="first_name"><?php _e('First Name') ?></label></th>
- <td><input type="text" name="first_name" id="first_name" value="<?php echo esc_attr($profileuser->first_name) ?>" class="regular-text" /></td>
+ <td>
+ <?php
+ if (!current_user_can('change_first_name'))
@pfactum
pfactum / mgn-improvements-v2.patch
Created July 26, 2012 18:33
MiniGal Nano improvements, v2
diff -Naur MiniGal Nano 0.3.5/config.php newmg/config.php
--- MiniGal Nano 0.3.5/config.php 2010-12-06 11:43:00.000000000 +0200
+++ newmg/config.php 2012-07-22 18:34:10.000000000 +0300
@@ -16,28 +16,28 @@
*/
// EDIT SETTINGS BELOW TO CUSTOMIZE YOUR GALLERY
-$thumbs_pr_page = "28"; //Number of thumbnails on a single page
-$gallery_width = "900px"; //Gallery width. Eg: "500px" or "70%"
+$thumbs_pr_page = "21"; //Number of thumbnails on a single page
@pfactum
pfactum / mgn-improvements-v3.patch
Created July 26, 2012 19:42
MiniGal Nano improvements, v3
diff -Naur MiniGal Nano 0.3.5/config.php newmg/config.php
--- MiniGal Nano 0.3.5/config.php 2010-12-06 11:43:00.000000000 +0200
+++ newmg/config.php 2012-07-22 18:34:10.000000000 +0300
@@ -16,28 +16,28 @@
*/
// EDIT SETTINGS BELOW TO CUSTOMIZE YOUR GALLERY
-$thumbs_pr_page = "28"; //Number of thumbnails on a single page
-$gallery_width = "900px"; //Gallery width. Eg: "500px" or "70%"
+$thumbs_pr_page = "21"; //Number of thumbnails on a single page