Skip to content

Instantly share code, notes, and snippets.

View VerosK's full-sized avatar
🚌
On the road.

Věroš Kaplan VerosK

🚌
On the road.
View GitHub Profile
@VerosK
VerosK / How to cut.md
Last active June 6, 2025 10:20
Silhouette Cameo in Linux

HOWTO cut

  • Create arbitrary .svg file in Inkscape
  • Limit draving area to the drawed entities ( File / Document Properties) + add 1 cm on each side
  • Set the drawin area width to 29cm (or width of the cutter).
  • Possible add random circles to to extend the drawing to the top.
  • Possible - convert all fonts into Paths ( Path / Object To Path )
  • Save that .svg
  • Open .svg in Robocut
  • Load landscape A4 media to plotter, add few milimeters extra
@VerosK
VerosK / ftdetect-icinga2.vim
Created January 11, 2015 14:21
Icinga2 syntax
" Vim Syntax detect file
" Upload this to ~/.vim/ftdetect/icinga2.vim
au BufRead,BufNewFile /etc/icinga2/*.conf set filetype=icinga2
>>> a_list = ['this is a list']
>>> def empty(something):
... del a_list[:]
...
>>> a_list
['this is a list']
>>> empty(a_list)
>>> a_list
[]
@VerosK
VerosK / strip-diacritics.py
Created April 16, 2015 19:49
Strip diacritics from UNICODE string
import unicodedata
unicode_string = u'Šílená kráva'
unicodedata.normalize('NFKD', unicode_string).encode('ASCII', 'ignore')
# out: 'Silena krava'
@VerosK
VerosK / python-zimbra-test.py
Last active August 29, 2015 14:20
Connect to zimbra with SOAP
#!/usr/bin/env python
from pythonzimbra.tools import auth
from pythonzimbra.communication import Communication
SOAP_URL = 'https://zimbra.random.eu/service/soap/'
SOAP_ADMIN_URL = 'https://zimbra.random.eu:7071/service/admin/soap/'
USER = 'admin'
PASSWORD = 'password'
@VerosK
VerosK / prune-catalog.pp
Created May 4, 2015 09:48
Bacula delete old messages from catalog
$messages_prune = '30 day'
cron{ 'bacula::catalog: Prune old messages from catalog':
command =>
"mysql --user='${dbuser}' --password='${dbpassword}' --host='${dbhost}' --execute='DELETE FROM Log where Time < (now() - INTERVAL ${messages_prune});' ${dbname}",
hour => [23,07],
minute => 16,
user => bacula,
}
@VerosK
VerosK / generator.py
Created May 20, 2015 18:04
Fail 2008
#!/usr/bin/env python
# -*- encoding: iso8859-2 -*-
WEB_2001 = '83.240.XX.XXX'
WEB_2008 = '193.19.XXX.XX'
MAIL_2001 = '83.240.39.188'
MAIL_2008 = '193.19.XXX.XX'
DEF_IP = WEB_2008
@VerosK
VerosK / parse-json.logstash.conf
Created May 28, 2015 11:19
Logstash - parse JSON
filter {
# if it looks like json, tag it
if [type] == 'syslog' and [message] =~ '{.*}' {
json {
source => 'message'
target => 'json_data'
add_tag => ['has_json']
}
}
@VerosK
VerosK / check_vendor.py
Created June 10, 2015 21:11
Check Django DB vendor
from django.db import connection
connection.vendor
# 'postgresql' or 'sqlite'
# via: http://stackoverflow.com/questions/18846174/django-detect-database-backend/18849255#18849255
@VerosK
VerosK / check_disks.conf
Created June 15, 2015 22:31
Check Windows Disks with NRPE over SOCKS
object CheckCommand "check_windows_disk_nrpe" {
import "plugin-check-command"
command = [ Socksify, "/usr/lib/nagios/plugins/check_nrpe" ]
arguments = {
"-H" = "$host.address$"
"-c" = "CheckDriveSize"
"-a" = {
value = "$nrpe_args$"
repeat_key = false