Skip to content

Instantly share code, notes, and snippets.

View cwerner1's full-sized avatar

Christian Werner cwerner1

View GitHub Profile
@unixweb
unixweb / fritz-box-callmonitor.json
Last active March 28, 2018 23:16
FritzBox Call Monitor with Web Push Notification
[
{
"id": "5201f39c.5bf36c",
"type": "inject",
"z": "bce2c081.53f4e",
"name": "Click to Test",
"topic": "Test Caller",
"payload": "{\"type\":\"INBOUND\",\"id\":\"0\",\"timestamp\":\"21.11.17 10:15:45\",\"caller\":\"0151123456789\",\"callee\":\"89898989\"}",
"payloadType": "json",
"repeat": "",
@yumminhuang
yumminhuang / secure_init.yml
Last active March 6, 2021 15:12
Securing a Ubuntu Server with Ansible
---
- hosts: all
vars:
root_password: xxx
common_user_password: xxx
common_user_name: deploy
ssh_port: 22
remote_user: root
@MohammadaliMirhamed
MohammadaliMirhamed / PhpFireBaseNotificationSample.php
Last active December 28, 2024 22:56
This repository showcases a simple and effective script to send push notifications to Android devices using Firebase Cloud Messaging (FCM). Designed for developers, the code provides a quick setup for integrating FCM notifications with minimal configuration.
<?php
#API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = $_GET['id'];
#prep the bundle
$msg = array
(
'body' => 'Body Of Notification',
@ezarko
ezarko / create_ref_repo.sh
Last active November 13, 2020 15:32
Creates a "reference repository" on a Jenkins slave to speed up build times.
#!/bin/bash
# Creates a "reference repository" on a Jenkins slave to speed up build times.
# Assumes that you will clone using HTTPS and enter username/password, then
# Jenkins will use an SSH key in the future.
#
# Works with Jenkins and GitLab. For other applications your mileage may vary.
REPO_SERVER=osn-git.us.oracle.com
REPO_PATH=ccs/caas.git
@t413
t413 / update.sh
Created July 23, 2016 00:11
manage a OpenWRT LetsEncrypt https instalation
#!/usr/bin/env sh
## update.sh - manage a OpenWRT LetsEncrypt https instalation
# HOWTO:
# - put update.sh in its own directory (like /root/.https)
# - run ./update.sh your.domain.com (that domain needs to point to your router)
# * this get an issued cert from letsencrypt.org using the webroot verification method
# * also installs curl and ca-certificates packages
# - use crontab -e; add the line `0 0 * * * "/root/.https/update.sh" >>/root/.https/log.txt 2>&`
# * this runs the update every day, logging everything to log.txt
#
@joashp
joashp / PushNotifications.php
Last active February 19, 2025 06:09
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
@TobiasWooldridge
TobiasWooldridge / gist:22f0cdca75190b9a473f
Last active April 26, 2025 22:49
How to Unbrick a Kindle Paperwhite

How to unbrick an Amazon Kindle Paperwhite™

This guide instructs you in how to unbrick an Amazon Kindle Paperwhite. The consequences of following it are your own responsibility. This method (opening the Kindle and using the serial interface) should be a last resort and should only be considered if other methods fail

The Guide

  1. Pry open Kindle using a prying tool
  2. Unscrew the screen and remove it from the base. Note that there's a screw hidden under the adhesive at the top in the middle
  3. Solder tin wire to serial ports on the bottom
  4. Attach tin wire to USB TTY device (order is ground, RX, TX, from the kindle's perspective, where GND is the smallest pad) and plug USB TTY device into your computer
  5. Open Putty on your computer in serial mode, with the serial port specified as your USB device and baud configured to 115200
@alexstone
alexstone / slack_notification.php
Created March 3, 2014 06:54
Fire a Slack Notification via CURL
<?php
// (string) $message - message to be passed to Slack
// (string) $room - room in which to write the message, too
// (string) $icon - You can set up custom emoji icons to use with each message
public static function slack($message, $room = "engineering", $icon = ":longbox:") {
$room = ($room) ? $room : "engineering";
$data = "payload=" . json_encode(array(
"channel" => "#{$room}",
"text" => $message,
@dghodgson
dghodgson / pulseaudio-auto-loopback.py
Last active December 15, 2019 05:29
A python script for automatically adding a loopback module to Pulse Audio for a bluetooth audio source when it's connected, and automatically removing the loopback module when the bluetooth device disconnects.Original code found here: https://gist.github.com/joergschiller/1673341/#comment-802735
#!/usr/bin/python
# based on monitor-bluetooth
# Changes by Domen Puncer <[email protected]>
import gobject
import dbus
import dbus.mainloop.glib
import os
@thgh
thgh / minepeon-build.md
Last active July 13, 2016 17:30
Rpi mining from scratch: Arch ARM, a webstack, cgminer and MinePeon.

Rpi mining from scratch

Powered by Arch ARM, Apache, PHP, cgminer and MinePeon.

Linux

Get Arch Linux ARM

Write Arch Linux ARM to SD and use it to boot your rpi.