Skip to content

Instantly share code, notes, and snippets.

Allan Laal allanlaal

Block or report user

Report or block allanlaal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@allanlaal
allanlaal / gist:5a203327cb712625c93c41dd8551f7b4
Created Mar 12, 2020
my 8 level (modifiers: Altgr, Shift, Caps) xkb keyboard layout 2020-03-12
View gist:5a203327cb712625c93c41dd8551f7b4
// @desc AIS keyboard layout
// @author Allan Laal <allan.laal@gmail.com>
// @install Add Estonian keyboard layout. delete old Estonian keyboard layout
// project location: /afs/acn/infra./laptop./keyboard./layout.
// actual layout path: /usr/share/X11/xkb/symbols
// $ sudo ln -sf /afs/acn/infra./laptop./keyboard./layout./ee /usr/share/X11/xkb/symbols/ex
//
// DEPRECATED?: RELOAD layout: setxkbmap -option lv3:caps_switch -option lv5:ralt_switch -option terminate:ctrl_alt_bksp -layout 'ex' -symbols 'alcom'
// setxkbmap -layout 'ex' -symbols 'alcom' -v 10
View dynamicStyles
var dynamicStyles = false;
var dynamicStylesCache = [];
var dynamicStylesLastId = 0;
/**
*
* @param ruleName string
* @param ruleContents array of key value pairs of CSS rules
@allanlaal
allanlaal / FF.toolbar.hide.keyconfig.js
Created Sep 14, 2014
Firefox: toggle visibility of toolbars (using KeyConfig)
View FF.toolbar.hide.keyconfig.js
// install the KeyConfig extension from http://mozilla.dorando.at/keyconfig.xpi and add this code as a new key
// First get all toolbars (that are not the tab bar)
var tbs = Array.filter(document.querySelectorAll('toolbar'), function (x) {
// remove // from the below line to keep showing the tabs toolbar:
//return x.id != 'TabsToolbar';
return true;
});
// For each toolbar
View zpanel_mysql_restarter.php
<?php
/**
* @desc MySQL restarter
* @example # /root/scripts/mysql_restarter.php >> /root/scripts/mysql_restarter.log
* @author Allan Laal <allan@permanent.ee>
* @since 2013-10-05
* @version DIRTY
*/
View zpanel_subdomain_bugfix_daemon.sh
#!/bin/sh
WORKDIR=/root/subdomain_bugfix_daemon/
# I recommend using a dedicated MySQL user with only SELECT rights if you are paranoid:
user="root"
pass="YOUR MYSQL PASSWORD HERE"
db="zpanel_core"
(mysql -u "$user" -p"$pass" "$db" <<EOF
SELECT COUNT(*) AS total FROM x_vhosts
EOF
@allanlaal
allanlaal / currency.sql
Last active Mar 9, 2020
SQL table of World currencies (even some expired ones) Source: http://bcmoney-mobiletv.com/blog/2008/12/30/currency-codes-dropdown-and-sql-table/ Cleaned up a bit, uses InnoDB and iso currency code as the PRIMARY key
View currency.sql
--
-- Table structure for table `currency`
--
CREATE TABLE IF NOT EXISTS `currency` (
`iso` char(3) CHARACTER SET utf8 NOT NULL DEFAULT '',
`name` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`iso`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
@allanlaal
allanlaal / countries.sql
Last active Dec 5, 2018 — forked from adhipg/countries.sql
uses InnoDB and UTF8, uses ISO2 code as the primary key
View countries.sql
--
-- Table structure for table `country`
--
CREATE TABLE IF NOT EXISTS `country` (
`iso` char(2) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
`nicename` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
`iso3` char(3) COLLATE utf8_unicode_ci DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
You can’t perform that action at this time.