Skip to content

Instantly share code, notes, and snippets.

View xhip's full-sized avatar
👋
Hi there!

Xhip xhip

👋
Hi there!
View GitHub Profile
@xhip
xhip / raspberry-pi-config.sh
Created July 17, 2018 21:53 — forked from lamberta/raspberry-pi-config.sh
Useful settings for my Raspberry Pi.
# Finish headless installation via `ssh pi@192.168.2.x`
# See /boot/config.txt
sudo apt-get update && sudo apt-get --purge dist-upgrade
sudo raspi-config
# Add locale en.us-utf8 (but keep en.gb-utf8)
sudo dpkg-reconfigure locales
# Timezone
sudo dpkg-reconfigure tzdata
# Update firmware
@xhip
xhip / WEBping.md
Last active April 11, 2017 19:34
Bash + PHP + cron = making a quick and dirty ping system

PHP PING - quick and dirty

NOTE:

This isn't the best way to do it! This is only for my case.

Idea:

I want to receive notifications if my laptop gets disconnect from the internet.

@xhip
xhip / led.sh
Last active June 22, 2022 21:52
Raspberry Pi model 2 B, B+ and A+ onboard LED control
#!/bin/bash
# Raspberry Pi model 2 B, B+ and A+ onboard LED control.
#
# <led>:
# led0 = ACT = Green
# led1 = PWR = Red
#
# Turn leds on (1) or off (0):
# echo 1 | sudo tee /sys/class/leds/<led>/brightness
# echo 0 | sudo tee /sys/class/leds/<led>/brightness
Prowl is a nice Growl client for iOS. One can use Prowl to send push notifications to an iOS device from essentially any computer with an internet connection.
The Prowl iOS app is inexpensive, and is available from the App Store. Sending notifications to iOS devices using Prowl is free of charge. There are, of course, alternative notification services available, including some that work with both iOS and Android devices (Prowl is iOS only as far as I am aware).
Prowl has a straightforward third-party API which allows notifications to be sent via Prowl using any modern programming language. There is an officially supported Perl script which can be easily used to send Prowl notifications from an internet connected Raspberry Pi. There are also a couple of third-party Python scripts available from the Prowl website which could alternatively be used.
In this post I’ve used the officially supported Prowl Perl script to show how one can send notifications to iOS devices from a Raspberry Pi running the standard Raspb
@xhip
xhip / phantomjs_debian.md
Last active August 29, 2015 14:06
How to install PhantomJS on Debian

How to install PhantomJS on Ubuntu

Version: 1.9.7

First, Get it from the PhantomJS website.

Update first and install the base: (root here)

apt-get update
@xhip
xhip / Prntscr.sh
Last active August 29, 2015 14:04
Prntscr bypass
#!/bin/bash
# ----------------------------------
# Prntscr.sh - Get image link only
# ----------------------------------
URL="$1"
if [ $(echo "$URL" | grep -E "^http:\/\/prntscr.com\/[0-9a-zA-Z]{6}$") ]; then
CODE=$(curl -sf "$URL" | head -n 1 | sed -e 's/.*<meta name="twitter:image:src" content="\([^"]*\)".*/\1/')
echo "prntscr: $CODE"
else