Skip to content

Instantly share code, notes, and snippets.

View igalic's full-sized avatar
🔇
dnd

Mina Galić igalic

🔇
dnd
View GitHub Profile
@igalic
igalic / restore-zimbra-config+mails.sh
Last active August 17, 2023 06:44
Restore Zimbra's ldap, mysql and config from backup, as well as the store
#!/bin/bash
# sources
# https://wiki.zimbra.com/wiki/LDAP_data_import_export
# http://wiki.zimbra.com/wiki/Mysql_Crash_Recovery
# http://wiki.zimbra.com/wiki/CLI_zmvolume
set -e
# set limits as per zmslapadd
ulimit -n 32768
ulimit -c unlimited
@igalic
igalic / mailer.conf
Last active March 22, 2023 12:45
disable sendmail on FreeBSD, completely.
# if with the below rc.conf and periodic.conf settings you somehow still see logs like
# Nov 28 03:01:00 webproxy sendmail[41991]: My unqualified host name (webproxy) unknown; sleeping for retry
# Nov 28 03:02:00 webproxy sendmail[41991]: unable to qualify my own domain name (webproxy) -- using short name
# Nov 28 03:56:50 webproxy sendmail[74256]: My unqualified host name (webproxy) unknown; sleeping for retry
# Nov 28 03:56:51 webproxy sendmail[87297]: My unqualified host name (webproxy) unknown; sleeping for retry
# Nov 28 03:57:51 webproxy sendmail[74256]: unable to qualify my own domain name (webproxy) -- using short name
# Nov 28 03:57:51 webproxy sendmail[87297]: unable to qualify my own domain name (webproxy) -- using short name
# we can kill it off like this:
@igalic
igalic / Makefile
Created February 13, 2013 08:35
Makefile to create a root-ca, an intermediate signing CA. It can also be used to quickly create keys and Certificates and sign them with that intermediate CA. You should put the root-ca into your Trust Store (preferably as the only CA;) and make sure your programs validate it correctly.
root_DN = /CN=Esotericsystems Root Authority/C=AT/
issuing_DN = /CN=Esotericsystems Issuing Authority/C=AT/
passphrase:
echo -n changeme > $@
#
# Create param files, keys and Self-Signed Certificate for the Root CA
#
root-ca-dsa.param: passphrase
@igalic
igalic / logstash.conf
Last active November 25, 2020 08:37
Error: Cannot use more than 1 filter worker because the following plugins don't work with more than one worker: multiline, multiline, multiline
input {
# Redis
redis {
host => "127.0.0.1"
type => "redis-input"
data_type => "list"
key => "logstash"
}
lumberjack {
port => "1337"
# replace hiera-file with a custom lookeup_key backend
function profiles::file::hiera_backend(
String $key,
Hash $options,
Puppet::LookupContext $context,
) {
$contents = inline_template("<%= File.read('${options[path]}/${key}', mode: 'rb') {|f| f.read } if File.exists?('${options[path]}/${key}') %>")
if $contents == '' or $contents == undef {
$context.not_found
}
cptuser@cptadotfvm000000:/tmp$ sudo cloud-init query userdata
Traceback (most recent call last):
File "/usr/bin/cloud-init", line 11, in <module>
load_entry_point('cloud-init==19.4', 'console_scripts', 'cloud-init')()
File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 893, in main
get_uptime=True, func=functor, args=(name, args))
File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2558, in log_time
ret = func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/cloudinit/cmd/query.py", line 124, in handle_args
instance_data['userdata'] = util.load_file(user_data_fn)
@igalic
igalic / gsd-backlight-helper: wat?
Created October 28, 2018 15:43
what's gsd-backlight-helper doing, and how is that *helping* ?
Okt 28 16:41:34 sinix pkexec[13151]: meena: Executing command [USER=root] [TTY=unknown] [CWD=/home/meena] [COMMAND=/usr/lib/gnome-settings-daemon/gsd-backlight-helper --set-brightness 637]
Okt 28 16:41:35 sinix pkexec[13156]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Okt 28 16:41:35 sinix pkexec[13156]: meena: Executing command [USER=root] [TTY=unknown] [CWD=/home/meena] [COMMAND=/usr/lib/gnome-settings-daemon/gsd-backlight-helper --set-brightness 646]
Okt 28 16:41:35 sinix pkexec[13161]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Okt 28 16:41:35 sinix pkexec[13161]: meena: Executing command [USER=root] [TTY=unknown] [CWD=/home/meena] [COMMAND=/usr/lib/gnome-settings-daemon/gsd-backlight-helper --set-brightness 637]
Okt 28 16:41:36 sinix pkexec[13166]: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Okt 28 16:41:36 sinix pkexec[13166]: meena: Executing command [USER=root] [TTY=unknown] [CWD=/home/meena] [COMMAND=/usr/lib/gnome-set
@igalic
igalic / -
Created January 20, 2020 13:49
error: cannot find derive macro `Serialize` in this scope
--> plume-front/src/editor.rs:79:10
|
79 | #[derive(Serialize, Deserialize)]
| ^^^^^^^^^
error: cannot find derive macro `Deserialize` in this scope
--> plume-front/src/editor.rs:79:21
|
79 | #[derive(Serialize, Deserialize)]
@igalic
igalic / strace -C hello # compiled as rustc -C opt-level=s hello.rs
Last active January 5, 2020 13:43
87 syscalls; 7 of which result in an error; all of those are due to lookup attempts to /etc/ld.so.nohwcap (and one to /etc/ld.so.preload)
execve("./hello", ["./hello"], 0x7ffd3cf13d58 /* 68 vars */) = 0
brk(NULL) = 0x56039295a000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=91244, ...}) = 0
mmap(NULL, 91244, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4611488000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
if status --is-interactive
# solaris spoiled me…
set -xU MANWIDTH 72
set -xU LESS_TERMCAP_md (printf "\e[01;31m")
set -xU LESS_TERMCAP_me (printf "\e[0m")
set -xU LESS_TERMCAP_se (printf "\e[0m")
set -xU LESS_TERMCAP_so (printf "\e[01;44;33m")
set -xU LESS_TERMCAP_ue (printf "\e[0m")
set -xU LESS_TERMCAP_us (printf "\e[01;32m")