Skip to content

Instantly share code, notes, and snippets.

@Bonno
Bonno / icy_backup.sh
Created January 18, 2016 23:58
Backup and restore settings from and to your ICY E-thermostaat
# inlog gegevens zelf invullen:
user=
passwd=
# BACK UP
token=`curl -s --request POST "https://portal.icy.nl/login"; --data "username=$user&password=$passwd" | awk -F":" '{print $12}' | awk -F'"' '{print $2}'`
rm et.bup
echo -n `curl -s -H "Session-token:$token" --request GET "https://portal.icy.nl/data" ; | awk -F":" '{print $13}' | awk -F'"' '{print $1}' | sed s/"\["/"\,"/ | sed s/"],"// | sed s/\,/"\&week-clock[]="/g` >> et.bup
echo -n `curl -s -H "Session-token:$token" --request GET "https://portal.icy.nl/data" ; | awk -F":" '{print $14}' | awk -F'"' '{print $1}' | sed s/"\["/"\,"/ | sed s/"],"// | sed s/\,/"\&configuration[]="/g` >> et.bup
@Bonno
Bonno / ubuntu-rsyslog-hack.sh
Last active April 20, 2016 12:32 — forked from dragolabs/ubunru-rsyslog-hack.sh
Hack to repair 100% CPU load by rsyslog on ubuntu 12.04 in openvz
#!/bin/sh
service rsyslog stop
sed -i -e 's/^\$ModLoad imklog/#\$ModLoad imklog/g' /etc/rsyslog.conf
service rsyslog start
# http://localhost:8983
# Information for any lucene index through https://wiki.apache.org/solr/LukeRequestHandler
/solr/admin/luke?numTerms=0
# Wildcard query
/solr/select/?q=*%3A*&version=2.2&start=0&rows=10&indent=on
# Query for text
/solr/select?omitHeader=false&fl=*&sort=position_category_+asc&start=0&q=THIS_IS_THE_SEARCH_TEXT&json.nl=flat&qt=magento_nl&wt=xml&rows=100
@Bonno
Bonno / collection_values.php
Last active September 15, 2016 09:36
Simple and light way to build an array with the values of an collection withoud loading the complete objects in Magento
/** @var array $_productSkus */
protected $_productSkus;
/**
* Return the sku for a given productId
*
* @param $productId
* @return bool
*/
public function getProductSku($productId)
http://stackoverflow.com/questions/12168452/long-lasting-fb-access-token-for-server-to-pull-fb-page-info/21927690#21927690
Having found that it is possible to generate a Facebook Page Access Token that does not expire (with help from @Igy), here is a clear, step-by-step quide for all those looking to the same:
1. Make sure you are the admin of the FB page you wish to pull info from
2. Create a FB App (should be with the same user account that is the page admin)
3. Head over to the Facebook Graph API Explorer
4. On the top right, select the FB App you created from the "Application" drop down list
5. Click "Get Access Token"
6. Make sure you add the manage_pages permission
@Bonno
Bonno / howto-control-spotify.txt
Last active March 23, 2017 09:43
Control spotify in OS X
- Open Automator and create a new Service
- Change "service receives selected:" [text] to [no input]
- Add the "run apple script" action to the main screen
- Enter and save the following three apple scripts
- Go to keyboard shortcuts preference pane and configure your shortcuts to the newly created services
@Bonno
Bonno / README.md
Last active August 11, 2023 14:13
Opening multiple SSH sessions with iTerm automatically. To be used in an Automator flow.

Create a new Automater flow

Add 'Service'. Service receives 'no input' in 'iTerm'. Add 'Run AppleScript'.

@Bonno
Bonno / ca.md
Last active February 11, 2024 12:08 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

  1. After launching Rambox, open the Rambox Dev Tools.
  2. Run this script in the DevTools console

It will pull the team icon from each slack account you're connected to that has finished loading. If you log into another slack account later on in your session, you can run the script again to fill in any missing team icons.

@Bonno
Bonno / install_latest_docker_compose.sh
Last active May 22, 2019 17:55 — forked from luislobo/install_latest_docker_compose.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
##
## https://docs.docker.com/install/linux/docker-ce/ubuntu
##
# Install packages to allow apt to use a repository over HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common