Skip to content

Instantly share code, notes, and snippets.

View bergercookie's full-sized avatar
🤖
How much wood would a woodchuck chuck if a woodchuck could chuck wood?

Nikos Koukis bergercookie

🤖
How much wood would a woodchuck chuck if a woodchuck could chuck wood?
View GitHub Profile
@bergercookie
bergercookie / trakt-backup.php
Created February 22, 2024 10:49 — forked from darekkay/trakt-backup.php
Trakt.tv backup script
<?php
/*
Backup script for trakt.tv (API v2).
Live demo: https://darekkay.com/blog/trakt-tv-backup/
*/
// create a Trakt app to get a client API key: http://docs.trakt.apiary.io/#introduction/create-an-app
$apikey = "CLIENT_API_KEY";
@bergercookie
bergercookie / AllGattCharacteristics.java
Created May 22, 2022 12:23 — forked from sam016/AllGattCharacteristics.java
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
#[macro_export]
macro_rules! avec {
($($element:expr),*) => {{
// check that count is const
const C: usize = $crate::count![@COUNT; $($element),*];
#[allow(unused_mut)]
let mut vs = Vec::with_capacity(C);
$(vs.push($element);)*
vs
@avianey
avianey / script.sh
Created December 6, 2019 19:38
Wifi driver for XPS-15 with i7-9XXX Ubuntu 18.04
# https://askubuntu.com/questions/1156167/unable-to-get-wifi-adapter-working-clean-19-04-install-network-unclaimed
sudo apt update
sudo apt install git build-essential
git clone https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi.git
cd backport-iwlwifi/
make defconfig-iwlwifi-public
sed -i 's/CPTCFG_IWLMVM_VENDOR_CMDS=y/# CPTCFG_IWLMVM_VENDOR_CMDS is not set/' .config
make -j4
sudo make install
sudo modprobe iwlwifi
use std::collections::HashMap;
use std::fmt;
use std::io;
use std::num::ParseFloatError;
/*
Types
*/
#[derive(Clone)]
@bergercookie
bergercookie / install_ros2.sh
Last active April 11, 2019 09:39
Bash script for installing ROS2 binary packages on Ubuntu 16.04 / Ubuntu 18.04
#!/usr/bin/env bash
# Instructions: https://index.ros.org/doc/ros2/Installation/Linux-Install-Debians/
set -e
# flags
INSTALL_OPTIONAL=1
USE_ROS1_PKGS=1 # additional packages for examples
INSTALL_BASHRC_LINE=1
@sam016
sam016 / AllGattCharacteristics.java
Last active July 5, 2024 15:52
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@nalt
nalt / Shell: Check launch files against DTD
Last active June 25, 2023 17:25
Roslaunch XML schema, DTD and XSD
wget https://gist.githubusercontent.com/nalt/dfa2abc9d2e3ae4feb82ca5608090387/raw/roslaunch.dtd
find /opt/ros -iname '*.launch' -exec xmllint --valid --dtdvalid roslaunch.dtd --noout {} ';' 2>&1 | grep -v "no DTD found" | grep -v '<launch>'
# Missing DOCTYPE is reported as an error.
# $(...) will be rejected by this DTD for enum attributes
@bergercookie
bergercookie / setup-franz-ubuntu.sh
Last active January 6, 2018 13:08 — forked from ruebenramirez/setup-franz-ubuntu.sh
setup franz on ubuntu
#!/bin/bash
sudo rm -fr /opt/franz
sudo rm -fr /usr/share/applications/franz.desktop
# create installation dir
sudo mkdir -p /opt/franz
#install franz
@bergercookie
bergercookie / pass_open_doc.sh
Last active December 29, 2017 01:05
Script for decrypting and viewing docs stored in the Pass Unix Password Manager
#!/usr/bin/env bash
# vi:syntax=sh
# vi:filetype=sh
# Current script decrypts and opens a gpg-encrypted document that is stored in
# the password-store of the *pass* Unix password manager
#
# Support exists exclusively on Linux desktop platforms
function print_fatal_msg() {