Skip to content

Instantly share code, notes, and snippets.

View oliverralbertini's full-sized avatar

Oliver Albertini oliverralbertini

View GitHub Profile
@oliverralbertini
oliverralbertini / crash.log
Created December 22, 2019 23:37
/var/lib/bitlbee/crash.log
/usr/sbin/bitlbee(+0x25355)[0x55d4594de355]
/usr/sbin/bitlbee(+0x254ba)[0x55d4594de4ba]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7fe1d1ec5890]
/usr/lib/x86_64-linux-gnu/libpurple.so.0(purple_connection_error_reason+0x2d)[0x7fe1d2120bbd]
/usr/lib/purple-2/libslack.so(+0xdb9b)[0x7fe1c6021b9b]
/usr/lib/x86_64-linux-gnu/libpurple.so.0(+0x9edbf)[0x7fe1d2170dbf]
/usr/lib/x86_64-linux-gnu/libpurple.so.0(purple_util_fetch_url_request_data_len_with_account+0x23d)[0x7fe1d217102d]
/usr/lib/x86_64-linux-gnu/libpurple.so.0(purple_util_fetch_url_request_len_with_account+0x63)[0x7fe1d2171153]
/usr/lib/purple-2/libslack.so(+0xdb13)[0x7fe1c6021b13]
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4cd03)[0x7fe1d2cead03]
@oliverralbertini
oliverralbertini / test.awk
Last active October 4, 2019 00:22
merge krb5.conf files
BEGIN {
block_length = 0
block_has_diff = 0
}
{
if ( $0 ~ /{.*{/ || block_length ) {
if ( $1 != $2 )
block_has_diff++
block1[block_length] = $1
block2[block_length] = $2
@oliverralbertini
oliverralbertini / lpass-function.sh
Last active March 29, 2018 02:39
Get time in seconds until end of day to use as LPASS_AGENT_TIMEOUT
# .bashrc or .bash_profile
lpass ()
{
! [[ $1 == login ]] && {
command lpass "$@";
return
};
local pau_time current_time LPASS_AGENT_TIMEOUT;
if [[ $(uname) == [Ll]inux ]]; then
pau_time="$(date --date='6:00 pm today' +%s)";
@oliverralbertini
oliverralbertini / task.sh
Created March 14, 2018 17:46
installing chrome (not chromium)
# script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#sudo apt-get -y install libxss1 libappindicator1 libindicator7 libgconf-2-4
#wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
#sudo apt-get install -y fonts-liberation libasound2 libnspr4 libnss3 xdg-utils
#sudo dpkg -i google-chrome*.deb
#sudo apt-get install -fy
#
#sudo apt-get -y install xvfb
#
#sudo apt-get -y install unzip
@oliverralbertini
oliverralbertini / yubishell.sh
Created December 12, 2017 21:26
bash function to set up a gpg key from a yubikey as an ssh key
yubishell() {
(
gpg-connect-agent --quiet updatestartuptty /bye
export GPG_TTY=$(tty)
export SSH_AUTH_SOCK="$HOME/.gnupg/S.gpg-agent.ssh"
export PS1="\[\e[31m\][YUBI]\[\e[0m\] \$ "
if which kr > /dev/null 2>&1; then
kr unpair
fi
bash --norc
@oliverralbertini
oliverralbertini / IntersectionTwoSortedLists.java
Last active October 25, 2017 20:12
Finds the intersection of two sorted lists without duplicates
class IntersectionTwoSortedLists {
public static void main(String[] args) {
int[] a1 = { 2, 3, 3, 4, 6, 6, 8 };
int[] a2 = { 3, 3, 6, 7, 9 };
for (int c1 = 0, c2 = 0; c1 < a1.length && c2 < a2.length; ) {
if (a1[c1] < a2[c2]) c1++;
else if (a1[c1] > a2[c2]) c2++;
else {
if (c1 != a1.length - 1 && a1[c1] == a1[c1 + 1])
@oliverralbertini
oliverralbertini / LinearProbingHash.java
Last active October 21, 2017 21:16
Implement a HashTable using linear probing. Doesn't do array resizing, you could just double array, but better to have a prime M.
public class LinearProbingHash<Key, Value> {
private int N, M = 11;
private Key[] keys;
private Value[] vals;
public LinearProbingHash() {
keys = (Key[]) new Object[M];
vals = (Value[]) new Object[M];
}

Keybase proof

I hereby claim:

  • I am oliverralbertini on github.
  • I am oliveralbertini (https://keybase.io/oliveralbertini) on keybase.
  • I have a public key ASA_tOm4tB5j8h6dCor7jWBRmivicbp6M3v8tT4UFf19nAo

To claim this, I am signing this object: