Skip to content

Instantly share code, notes, and snippets.

View Vitexus's full-sized avatar
🤖
Coding as usual

Cybervitexus Vitexus

🤖
Coding as usual
View GitHub Profile
@Vitexus
Vitexus / gist:78efaf9ab8ff4e1d7ce4
Created May 7, 2015 09:43
Get all Host Status in icinga Hostgroup by name
SELECT * FROM icinga_objects o LEFT JOIN icinga_hoststatus s ON s.host_object_id = o.object_id WHERE object_id IN
(SELECT host_object_id FROM icinga_hostgroup_members WHERE hostgroup_id =
(SELECT hostgroup_id FROM icinga_hostgroups WHERE hostgroup_object_id =
(select object_id FROM icinga_objects WHERE objecttype_id = 3 AND name1 LIKE 'GROUPNAME')))
@Vitexus
Vitexus / nginx_enabled_urls.sh
Created November 29, 2015 09:43
List URLs of enabled nginx sites
#!/bin/sh
cat /etc/nginx/sites-enabled/* | grep server_name | awk '{ print "http://"$2 }' | sort | uniq | sed "s/;/\//"
@Vitexus
Vitexus / extlog.sh
Last active January 29, 2016 11:14
How to show logs on remote X display
#!/bin/bash
TERM="urxvt"
killall $TERM
killall x2x
export DISPLAY=10.1.0.9:0
$TERM -sl 0 -geometry 320x20 -e ~/bin/syslog &
$TERM -sl 0 -geometry 320x30+0+265 -e ~/bin/sqllog &
$TERM -sl 0 -geometry 320x30+0+660 -e ~/bin/webserverlog &
x2x -west -from :0 &
@Vitexus
Vitexus / backuppcetc.sh
Created November 24, 2016 22:59
Make backup for given host's /etc/ by one command ( by using BackupPC )
#!/bin/bash
#1) Ask for host
if [ -z $1 ];
then
echo -n "Host to backup and press [ENTER]: "
read sourcehost
else
sourcehost=$1
fi
@Vitexus
Vitexus / movedone.js
Created December 7, 2016 14:24
FiltaQuilla script to move all ticket messages to folder "done"
/*
* FiltaQuilla script to move all ticket messages to folder "done"
*/
destfolderName = "done";
Components.utils.import("resource:///modules/iteratorUtils.jsm");
Components.utils.import("resource:///modules/MailUtils.js");
let acctmgr = Cc["@mozilla.org/messenger/account-manager;1"].getService(Ci.nsIMsgAccountManager);
@Vitexus
Vitexus / Vagrantfile
Created May 4, 2017 16:28
Instant Redmine Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# 1) Create an directory
# 2) Put this Vagrantfile and your Redmine (EasyRedmine/EasyProject) zip Archive into
# 3) vagrant up
# 4) wait for provision to be done
# 5) run command: sudo -H -u easy bash -c ..
# 6) reboot the vagrant virtual machine
# 7) see application in action on http://localhost:8080
@Vitexus
Vitexus / flexibee-evidencies.sql
Created November 18, 2017 01:20
SQL Queries For Each FlexiBee evidence
This file has been truncated, but you can view the full file.
############################################ analyza-nakupu ###########################################################
/* centralServer LOG*/ select hodnota from cssetting where klic = $1
/* centralServer DETAIL*/ parameters: $1 = 'ACCESS_CONTROL_ALLOW_ORIGIN'
/* centralServer LOG*/ select a.attname from pg_class c join pg_attribute a on a.attrelid = c.oid join pg_type t on t.oid = a.atttypid where relname = 'csuzivatel' and a.attnum > 0 and not a.attisdropped order by a.attnum
/* centralServer LOG*/ SELECT max(dbversion) FROM dbversion WHERE needreimport = 't'
/* centralServer LOG*/ select u.idcsuzivatel, u.jmeno, u.create_company, u.manage_all, u.create_user, u.change_password, u.delete_company, u.grant_permission, u.license_mgmt, u.deleted, u.blocked, u.blocked_text, u.create_dt, u.idcsskupina, u.sso_identifier, u.dbusername, u.default_role, u.given_name, u.family_name, u.email, u.mobile, u.system_user, u.last_dt, u.user_type from csuzivatel u where lower(u.jmeno) = lower($1) and not u.delet
<?php
define('EASE_LOGGER', 'console|syslog');
define('EASE_APPNAME', 'FioCaptions');
require_once 'config.php'; //SetUp FlexiBee and Fio constatnts
$banker = new \FlexiPeeHP\Banka();
$downloader = new \FioApi\Downloader(constant('FIO_RO_TOKEN'));
try {
@Vitexus
Vitexus / blockchain-table.php
Created April 7, 2018 13:20
BlockChain LIKE MySQL Table using PHP Phinx
<?php
use Phinx\Migration\AbstractMigration;
class UserLog extends AbstractMigration
{
public $tableName = 'user_log';
public function up()
@Vitexus
Vitexus / flexibee-countries-translations.json
Last active June 12, 2018 22:06
Import this file into your FlexiBee to use country names with English, Deutch or French language
{
"winstrom": {
"@version": "1.0",
"stat": [
{
"id": "code:AW",
"nazev": "Aruba",
"nazevA": "Aruba",
"nazevB": "Aruba",
"nazevC": "Aruba",