Skip to content

Instantly share code, notes, and snippets.

@Thrilleratplay
Thrilleratplay / notify-send-all-users.sh
Created June 14, 2020 17:09
Send notification to all users with x11 sessions. Useful for sending notifications from scripts that are run as root.
#!/usr/bin/env bash
# Send notification to all users with x11 sessions. Useful for sending notifications
# from scripts that are run as root.
#
#
# EXAMPLES:
#
# $> notify-send-all-users.sh Hello!
#
@MIvanchev
MIvanchev / article.md
Last active April 4, 2023 13:39
Ever wondered what it takes to run Windows software on ARM? Then this article might be for you!
@anttisalonen
anttisalonen / main.rs
Created October 7, 2018 20:52
yew + websocket echo client
#[macro_use]
extern crate yew;
extern crate failure;
use failure::Error;
use yew::prelude::*;
use yew::format::Json;
use yew::services::ConsoleService;
use yew::services::websocket::{WebSocketService, WebSocketStatus, WebSocketTask};
@fawkesley
fawkesley / randomize-mac-addresses.sh
Last active July 25, 2022 06:24
In Ubuntu 16.04, randomize WiFi MAC addresses with a daily rotation - /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh
#!/bin/sh
# /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh
# INSTALL
#
# > curl -L 'https://gist.github.com/paulfurley/46e0547ce5c5ea7eabeaef50dbacef3f/raw/56ee5dd5f40dec93b8f7438cbdeda5475ea3b5d2/randomize-mac-addresses.sh' |sudo tee /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh
# > sudo chmod +x /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh
# Configure every saved WiFi connection in NetworkManager with a spoofed MAC
@thiagowfx
thiagowfx / FindBoost.cmake
Last active February 22, 2023 15:46
FindBoost.cmake (Note: DO NOT DELETE as it's linked from Stack Overflow)
# - Find Boost
#
# Copyright (c) 2016 Thiago Barroso Perrotta
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
@con-f-use
con-f-use / esp-clone.sh
Last active November 20, 2017 20:47
Automatically clone and build repositories related to the esp8266 sdk
#!/bin/bash
# Build the esp 8266 open-sdk and related tools in current directory.
#
# Tested on Ubuntu 16.04.1 and 14.04.4/5.
# It takes up to an hour to build and several GB of space, so be prepared!
#
# Use it with:
# wget -O esp-clone.sh https://gist.githubusercontent.com/con-f-use/d086ca941c2c80fbde6d8996b8a50761/raw && chmod +x esp-clone.sh && ./esp-clone.sh
#
# ToDo: Ask the user when install installing examples or checking for Ubuntu, make a -y option to proceed automatically
@gongzhitaao
gongzhitaao / CMakeLists.txt
Created October 7, 2013 04:23
A Minimum Working Example Using CMake to build project with Qt5 forms
# suppose you have created a ui file called configwin.ui
cmake_minimum_required (VERSION 2.6)
project(tst)
find_package(Qt5Widgets)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: