Skip to content

Instantly share code, notes, and snippets.

View kalkin's full-sized avatar

Bahtiar Gadimov kalkin

View GitHub Profile
if($_SERVER['HTTP_HOST'] === 'example.com')
{
$config['View_Helper_CSS']['basePath'] = '/temaplateA/';
}else{
$config['View_Helper_CSS']['basePath'] = '/temaplateB/';
}
if (!DB.jndiJdbcConnAvailable_?) DB.defineConnectionManager(MySqlDbVendor(("jdbc:mysql://localhost:3306/example", "user", "password")
@kalkin
kalkin / privoxy-blocklist.sh
Created February 20, 2013 21:51
A script to convert AdBlockPlus-lists into Privoxy-lists and install them.
#!/bin/bash
#
######################################################################
#
# Author: Andrwe Lord Weber
# Mail: lord-weber-andrwe<at>renona-studios<dot>org
# Version: 0.2
# URL: http://andrwe.dyndns.org/doku.php/blog/scripting/bash/privoxy-blocklist
#
##################
@kalkin
kalkin / Timeline config
Last active December 29, 2015 20:39
This should be a timeline which shows parent headings
(setq org-agenda-prefix-format
'((timeline .
"%-12:c %(concat \"[ \"(org-format-outline-path (org-get-outline-path)) \"]\") "
))
)
_qvm-run() {
local app_vms
app_vms=( $(qvm-ls --raw-list|grep -v "^dom0$") )
local exc=
if (( words[(I)--all] )); then
exc="*--exclude=[When --all is used: exclude this VM name (may be repeated)]:QubesVMs:($app_vms)"
fi
_arguments -S '(-a --auto)'{-a,--auto}'[Auto start the VM if not running]'\
@kalkin
kalkin / qls
Last active June 18, 2016 15:28
#!/bin/sh
# vim: fdm=marker sw=4 ts=4 tw=80
# Author: Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de>
set -e
print_help() {
echo "Usage: qls [-1ahrstAHNPT]"
echo "Print QubesVMs. By default only running and transient vms are printed"
echo
echo "Optional arguments:"
@kalkin
kalkin / gist:ef0b0fa656eb298be4b0
Created December 28, 2014 21:42
Thinkpad X220 Centos 7 Rotate Script
case $(xrandr|grep LVDS|sed -e 's/(.*$//'|cut -d" " -f5) in
"") # Screen is not rotated, we should rotate it right (90°)
xrandr -o 3
;;
*) # screen is rotated, we should set it normal (0°)
xrandr -o 0
#!/usr/bin/python
DOCUMENTATION = '''
---
module: qvm
short_description: check state presence/absence/running/halted of a qubes vm
description:
- check presence/absence/running/halted of a qubes vm. If a vm is not
running it will be started. If vm is not halted it will be stopped.
options:
#!/bin/python
import fcntl
from ansible.callbacks import vvv, vv
from ansible import errors
from ansible import utils
from qubes.qubes import QubesVmCollection
import subprocess
import os
import logging
log = logging.getLogger('Ansible Qubes Connection')
my role X::Comp { ... }
my class X::ControlFlow { ... }
my class Exception {
has $!ex;
has $!bt;
method backtrace(Exception:D:) {
if $!bt { $!bt }
elsif nqp::isconcrete($!ex) {