Skip to content

Instantly share code, notes, and snippets.

Avatar
🐣
taking care of my daughter

Mina Galić igalic

🐣
taking care of my daughter
View GitHub Profile
@igalic
igalic / mailer.conf
Last active Nov 28, 2020
disable sendmail on FreeBSD, completely.
View mailer.conf
# 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:
View gist:5cf3928f29ad1a5211af16995ef377d4
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)
View -
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 Jan 5, 2020
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)
View strace -C hello # compiled as rustc -C opt-level=s hello.rs
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
View gist:80c0f9ed02c270ea58fa8852698dd03c
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")
View foo.rs
match req {
Ok(mut res) => {
if let Ok(text) = &res.text() {
if let Ok(ap_sign) = serde_json::from_str::<ApSignature>(text) {
if let Ok(mut json) = serde_json::from_str::<CustomPerson>(text) {
json.custom_props = ap_sign; // without this workaround, publicKey is not correctly deserialized
Some(json)
} else {
None
}
@igalic
igalic / zpool failure
Created Nov 14, 2018
zpool cmdline != zpool
View zpool failure
======================================================================
FAIL: tests.unittests.test_handler.test_handler_resizefs.TestResizefs.test_handle_modern_zfsroot
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/meena/src/cloud/cloud-init/.tox/py3/lib/python3.7/site-packages/mock/mock.py", line 1305, in patched
return func(*args, **keywargs)
File "/home/meena/src/cloud/cloud-init/tests/unittests/test_handler/test_handler_resizefs.py", line 207, in test_handle_modern_zfsroot
dresize.call_args[0][0][0])
AssertionError: ('zpool', 'online', '-e', 'zroot', '/dev/da0p3') != 'zpool'
@igalic
igalic / gsd-backlight-helper: wat?
Created Oct 28, 2018
what's gsd-backlight-helper doing, and how is that *helping* ?
View gsd-backlight-helper: wat?
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
View foo.rb
newproperty(:rlimits) do
desc <<-EOM
A Hash of rlimits for this jail
Example:
jail { xforkb:
ensure => present,
rlimits => { nproc => {action => deny, amount => 50}}
}
View hiera_backend.pp
# 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
}