Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View medigeek's full-sized avatar
💭
▶️ Entering flow state✨

Savvas Radevic medigeek

💭
▶️ Entering flow state✨
View GitHub Profile
@medigeek
medigeek / fix_makefile.patch
Created February 5, 2012 21:32
lingua: Makefile (quilt patch)
From: Savvas Radevic <vicedar@gmail.com>
Description: Fix Makefile:
* Change main installation path to /usr/share/java/lingua
* mkdir /usr/bin
* Remove $(DESTDIR) from /usr/bin/lingua contents
Index: lingua-0.0.4/Makefile
===================================================================
--- lingua-0.0.4.orig/Makefile 2012-02-07 21:10:49.000000000 +0100
+++ lingua-0.0.4/Makefile 2012-02-07 21:10:50.000000000 +0100
@medigeek
medigeek / remove_absolute_paths.patch
Created February 7, 2012 16:15
glossa-interpreter: Remove absolute paths (quilt patch)
From: Savvas Radevic <vicedar@gmail.com>
Description: Remove absolute path from filenames
Index: glossa-interpreter-1.0.1/src/glossa/interpreter/core/ASTInterpreter.java
===================================================================
--- glossa-interpreter-1.0.1.orig/src/glossa/interpreter/core/ASTInterpreter.java 2012-02-07 16:24:50.000000000 +0100
+++ glossa-interpreter-1.0.1/src/glossa/interpreter/core/ASTInterpreter.java 2012-02-07 16:29:24.000000000 +0100
@@ -202,7 +202,7 @@
@medigeek
medigeek / fix_makefile.patch
Created February 7, 2012 16:19
glossa-interpreter: Fix Makefile (quilt patch)
From: Savvas Radevic <vicedar@gmail.com>
Description: Create /usr/bin in the destination folder
Index: glossa-interpreter-1.0.1/Makefile
===================================================================
--- glossa-interpreter-1.0.1.orig/Makefile 2012-02-07 17:14:00.000000000 +0100
+++ glossa-interpreter-1.0.1/Makefile 2012-02-07 17:14:01.000000000 +0100
@@ -36,6 +36,7 @@
install:
#!/usr/bin/make -f
# -*- makefile -*-
# Copyright (c) 2012, Savvas Radevic <vicedar@gmail.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@medigeek
medigeek / pamtest.py
Created February 22, 2012 00:47
Idea for timekpr
#!/usr/bin/python
# sudo ./pamtest.py <username>
# If your run this as root, you don't need authentication.
# Perfect for True or False (if user is allowed to login or not)
import sys
import PAM
from getpass import getpass
def pam_conv(auth, query_list, userData):
@medigeek
medigeek / 02_fix-infinite-loop.patch
Created March 4, 2012 17:54
quilt patch: fix infinite loop in libarchive when reading xps file [fixes conversion issue for libgxps-utils (e.g. xpstopdf)]
Origin: https://code.google.com/p/libarchive/issues/detail?id=226
Description: Fix issue 226 (infinite loop while using libgxps-utils).
The patch is from this merge (adopted to match 3.0.3 release):
https://github.com/libarchive/libarchive/commit/f7cd53ca1eda0d08fc3b3876ed474321b9f70ac7
Index: libarchive-3.0.3/libarchive/archive_read_support_format_zip.c
===================================================================
--- libarchive-3.0.3.orig/libarchive/archive_read_support_format_zip.c 2012-03-04 16:01:31.000000000 +0100
+++ libarchive-3.0.3/libarchive/archive_read_support_format_zip.c 2012-03-04 16:08:52.000000000 +0100
@@ -1093,7 +1093,7 @@
@medigeek
medigeek / ignore_fiemap_errors.patch
Created March 9, 2012 20:43
libarchive 3.x - quilt patch: Ignore FIEMAP errors on linux < 2.6.28 - e.g. https://bugs.launchpad.net/bugs/942994
Origin: https://code.google.com/p/libarchive/issues/detail?id=238
Description: Ignore FIEMAP errors on linux < 2.6.28
(most launchpad build daemon servers use ubuntu hardy)
https://bugs.launchpad.net/bugs/942994
Index: libarchive-3.0.3/libarchive/archive_read_disk_entry_from_file.c
===================================================================
--- libarchive-3.0.3.orig/libarchive/archive_read_disk_entry_from_file.c 2012-03-15 23:48:52.000000000 +0100
+++ libarchive-3.0.3/libarchive/archive_read_disk_entry_from_file.c 2012-03-15 23:49:00.000000000 +0100
@@ -855,16 +855,9 @@
@medigeek
medigeek / pyurl2file.py
Created July 25, 2012 16:03
Improve http://stackoverflow.com/a/22776/286994 (using .format() instead of % string formatting)
#!/usr/bin/python
# Improve http://stackoverflow.com/a/22776/286994
# (using .format() instead of % string formatting)
import sys
import urllib2
file_name = url.split('/')[-1]
u = urllib2.urlopen(url)
f = open(file_name, 'wb')
@medigeek
medigeek / joomla-reset-two-factor.php
Created April 9, 2018 23:28
Joomla 3.x - Disable two factor authentication plugin, clear otpKey and otep values for all Super Users
<?php
/* This script disables Joomla!'s two factor authentication
* plugin and clears the otpKey and otep values for Super
* Users. It allows you to login when you aren't able to
* use Google authenticator for any reason.
* Usage:
* Place it in the Joomla! 3.x root dir (where configuration.php
* and index.php are) and run it. Then login and leave the
@medigeek
medigeek / ebay_siteid_sitename_globalid_map.php
Created July 7, 2018 18:43
eBay Site ID to Global ID Mapping PHP array
<?php
// Just a basic concept/array of eBay Site ID, Global ID and Site Name
// https://developer.ebay.com/devzone/merchandising/docs/concepts/siteidtoglobalid.html
$ebay_array = [
"siteid" => [
"0", "2", "3", "15", "16",
"23", "71", "77", "100", "101",
"123", "146", "186", "193", "201",
"203", "205", "207", "210", "211",