Skip to content

Instantly share code, notes, and snippets.

@darookee
darookee / show-event-details-on-cart.php
Last active July 4, 2023 08:47 — forked from andrasguseo/show-event-details-on-cart.php
Show event title and date on WooCommerce cart page
<?php
add_filter( 'woocommerce_cart_item_name', 'krbu_event_title', 10, 3 );
function krbu_event_title($title, $values, $cart_item_key) {
$ticket_meta = get_post_meta($values['product_id']);
$event_id = absint($ticket_meta['_tribe_wooticket_for_event'][0]);
$venue_id = tribe_get_venue_id($event_id);
if ($event_id) {
@darookee
darookee / Dockerfile
Last active April 27, 2023 15:34
simple python crawler
# Use an official Python runtime as a parent image
FROM python:3.9-slim-buster
# Set the working directory to /app
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt .
# Install the required Python packages
@darookee
darookee / automation-notifications.yaml
Last active October 18, 2022 07:53
home-assistant - kaffee ist fertig
---
- alias: prepare coffee notification
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.kaffeemaschine_power
above: '80'
for: '00:01:30'
action:
- service: input_boolean.turn_on
==================================================
Starting the Dafang Hacks Custom Application Layer
==================================================
loaded common functions
wpa_supplicant: Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
nl80211: Could not re-add multicast membership for vendor events: -2 (No such file or directory)
udhcpc: udhcpc (v1.22.1) started
Sending discover...
Sending discover...
Verifying that "darookee.id" is my Blockstack ID. https://explorer.blockstack.org/name/darookee.id
@darookee
darookee / README.md
Last active February 4, 2018 20:01
Convert Gitlab installation from MySQL to a docker-based installation using PostgresQL
  1. Create a backup of the source gitlab server with gitlab-rake gitlab:backup:create
  2. Create a seperate MySQL dump of the source database using mysqldump [...] <gitlab-database-name> > database.sql
  3. Create a new directory to store the mysql-dump and the docker-compose-mysql.yml; database.sql belongs into the subfolder 'mysql' (as it is set in the docker-compose.yml) ./ ./mysql/database.sql ./docker-compose-mysql.yml
  4. Optional: edit docker-compose-mysql.yml to use the correct database images, mysql should be the same as your source mysql (or mariadb) version, postgres should match the version used in your gitlab-docker-image
  5. Start the two containers using docker-compose -f docker-compose-mysql.yml up --build -d
  6. Start the gitlab container using docker-compose, adding the database related configration from docker-compose-gitlab.yml to your own configuration
  7. Link the two containers using docker network connect
@darookee
darookee / mine-top-coin.sh
Created June 25, 2017 20:20
Start mining coins recommended by whattomine
#!/bin/bash
# this script expects scripts named <cointag> in the minerscripts sub directory
# Passing 'i' to this scripts will ask before starting to mine, answer 'n' to quit
# or 'c' to ask for the next available coin
# running without arguments starts mining the first available coin
#
# Example:
#
# cat ./minerscripts/ETH
@darookee
darookee / WiFi_RGB_MQTT_ESP8266.ino
Created April 27, 2017 14:48
Arduino-Code for cheap ESP8266 based WiFi RGB-Controller
#include <ESP8266WiFi.h>
#include <DNSServer.h> //Local DNS Server used for redirecting all requests to the configuration portal
#include <ESP8266WebServer.h> //Local WebServer used to serve the configuration portal
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager WiFi Configuration Magic
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <EEPROM.h>
#include <PubSubClient.h> // https://github.com/Imroy/pubsubclient
@darookee
darookee / Dockerfile
Created March 20, 2017 15:56
Run opus in docker-container
FROM php:7.1-apache
RUN export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
&& apt-get update > /dev/null \
&& apt-get install -yyq \
git \
curl \
unzip \
> /dev/null \
&& docker-php-ext-install \
@darookee
darookee / add_tor_host.sh
Created January 27, 2017 10:36
Add all current tor exit nodes to hosts.deny
{ curl -s "https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=$(curl -s ipv4.ipchimp.net)&port=80"|sed 's/^[^#]/ALL\: /g'; cat /etc/hosts.deny ;} |sort|uniq -u|sed 's/^#.*//g' > /etc/hosts.deny