Skip to content

Instantly share code, notes, and snippets.

View skarllot's full-sized avatar
💭
I may be slow to respond.

Fabrício Godoy skarllot

💭
I may be slow to respond.
View GitHub Profile
for icon_size in 16 20 22 24 32 36 48 64 96 128 192; do
xdg-icon-resource uninstall --context mimetypes --size $icon_size application-pdf.png
xdg-icon-resource uninstall --context mimetypes --size $icon_size application-fdf.png
xdg-icon-resource uninstall --context mimetypes --size $icon_size application-pdx.png
xdg-icon-resource uninstall --context mimetypes --size $icon_size application-xdp+xml.png
xdg-icon-resource uninstall --context mimetypes --size $icon_size application-xfdf.png
done
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define TIPOS_VINHOS 3
#define BUFFER_SIZE 10
struct vinho_t {
char id;
char *name;
@skarllot
skarllot / gist:584088
Created September 17, 2010 11:39
tcpdump
08:49:11.484449 IP 95.211.16.86.80 > 189.19.61.119.33883: . 258784:260244(1460) ack 239 win 6432
08:49:11.494422 IP 95.211.16.86.80 > 189.19.61.119.33883: . 260244:261704(1460) ack 239 win 6432
08:49:11.494484 IP 189.19.61.119.33883 > 95.211.16.86.80: . ack 261704 win 65535
08:49:11.506460 IP 95.211.16.86.80 > 189.19.61.119.33883: . 261704:263164(1460) ack 239 win 6432
08:49:11.516427 IP 95.211.16.86.80 > 189.19.61.119.33883: . 263164:264624(1460) ack 239 win 6432
08:49:11.516488 IP 189.19.61.119.33883 > 95.211.16.86.80: . ack 264624 win 65535
08:49:11.524414 IP 95.211.16.86.80 > 189.19.61.119.33883: . 264624:265919(1295) ack 239 win 6432
08:49:11.524475 IP 189.19.61.119.33883 > 95.211.16.86.80: . ack 265919 win 65535
08:49:11.538420 IP 95.211.16.86.80 > 189.19.61.119.33883: . 265919:267379(1460) ack 239 win 6432
08:49:11.548454 IP 95.211.16.86.80 > 189.19.61.119.33883: . 267379:268839(1460) ack 239 win 6432
@skarllot
skarllot / USB Dongle
Created November 23, 2010 18:00
lsusb -v
Bus 001 Device 004: ID 0e40:0001
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0e40
Module Size Used by
tun 80833 16
ipt_REJECT 38977 2
autofs4 63049 3
cpufreq_ondemand 42449 1
acpi_cpufreq 47937 7
freq_table 38977 2 cpufreq_ondemand,acpi_cpufreq
ip_conntrack_netbios_ns 36033 0
iptable_nat 40773 0
ip_nat 53101 1 iptable_nat
@skarllot
skarllot / remoteservice.sh
Created January 20, 2012 13:03
Zabbix external script to check Windows service via SNMP
#!/bin/bash
# -----------------------------------------------------------------------------
# Check service status
#
# Params: hostname, ip, community, servicename, serviceparams
# -----------------------------------------------------------------------------
# $1 Remote IP
# $2 Service name
@skarllot
skarllot / pam_userdb_admin.pl
Created March 15, 2012 18:54
Script to manage database file for PAM authentication (vsftpd)
#!/usr/bin/perl -w
#
# pam_userdb_admin.pl - pam_userdb(8) authentication database management tool
#
# Copyright (c) 2011 EPIPE Communications <http://epipe.com/>
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided
# that the above copyright notice and this permission notice appear
# in all copies.
@skarllot
skarllot / bacula-last-volume-name.sql
Created March 28, 2012 20:17
Gets last volume name from each pool group into Bacula database
SELECT vc1.*
FROM PoolGroup AS pg
INNER JOIN VolumeCatalog AS vc1 ON (vc1.VolumeName LIKE pg.Filter)
WHERE vc1.VolumeName =
(SELECT VolumeName
FROM VolumeCatalog AS vc2
WHERE vc2.VolumeName LIKE pg.Filter
ORDER BY VolumeName DESC
LIMIT 1)
;
@skarllot
skarllot / utrends_businesshours.sql
Created April 19, 2012 19:17
Extract trends from zabbix database cropping not workday, holidays (from GLPI) and not business hours
CREATE VIEW `zabbix_dw`.`utrends_businesshours` AS
SELECT h.host,
i.key_,
FROM_UNIXTIME(tu.clock) AS `time`,
tu.value_min,
tu.value_avg,
tu.value_max
FROM `zabbix`.`hosts` h
INNER JOIN `zabbix`.`items` i ON i.hostid = h.hostid
INNER JOIN `zabbix`.`trends_uint` tu ON tu.itemid = i.itemid
@skarllot
skarllot / backup_mysqldb.sh
Last active November 30, 2022 08:50
Bash script to backup all mysql databases thru mysqldump
#!/bin/bash
# Destiny folder where backups are stored
DEST=/tmp/bacula/server01
CURRDATE=$(date +"%F")
# Hostname where MySQL is running
HOSTNAME="srv-mysql"
# User name to make backup
USER="root"