Skip to content

Instantly share code, notes, and snippets.

@dragolabs
dragolabs / ovpn_in_lxc.md
Last active December 30, 2022 17:11
Openvpn server in lxc container

How to run openvpn in LXC container

For running openvpn server (or client) in CT you need to create tun (tap?) device.

In lxc config of container add line above. In proxmox we can find configs in /etc/pve/local/lxc/

lxc.cgroup.devices.allow: c 10:200 rwm

Then [re]start container and create tun device inside it. You can login into container or use proxmox tool pct:

@laracasts
laracasts / gist:f4a304232c1be6dbb4f8
Last active February 16, 2023 20:19
Laracasts PHPStorm theme.
@zspine
zspine / Example.php
Created February 22, 2012 17:33
Pimcore Object toArray()
<?php
class Website_Model_Product extends Object_Concrete
{
/**
* Retreive the values in an array
*
* @return array
*/
public function toArray()
hass:account
hass:alert
hass:alert-circle
hass:altimeter
hass:apple-safari
hass:apps
hass:arrow-bottom-left
hass:arrow-down
hass:arrow-left
hass:arrow-right
@leymannx
leymannx / iterm2-oh-my-fish.md
Last active December 31, 2023 16:37
iTerm2 Solarized Dark theme + Fish shell + oh-my-fish /// macOS High Sierra
@herzig
herzig / esp-idf_i2c_scan
Created August 9, 2019 10:12
esp32 i2c scan (esp-idf)
// setup i2c master
static esp_err_t i2c_master_init()
{
i2c_config_t conf;
conf.mode = I2C_MODE_MASTER;
conf.sda_io_num = I2C_SDA_PIN;
conf.scl_io_num = I2C_SCL_PIN;
conf.sda_pullup_en = GPIO_PULLUP_ENABLE;
conf.scl_pullup_en = GPIO_PULLUP_ENABLE;
conf.master.clk_speed = I2C_MASTER_FREQ_HZ;
@ivanvermeyen
ivanvermeyen / HOWTO.md
Last active January 14, 2024 03:02
Multiple MySQL versions on MacOS with Homebrew

Update - 4 september 2020

Making multiple MySQL versions work with Homebrew was tricky to say the least. Fortunately there are 2 new easy ways that I learned of to achieve this.

DBngin app

As @4unkur and @henrytirla commented below, there is this extremely easy to use app called DBngin, which lets you setup multiple databases (not only MySQL) simultaneously using different ports:

https://dbngin.com/

@sergiojovanig
sergiojovanig / magento2-clear.sql
Last active January 15, 2024 12:25
Magento 2 Clear Database
##########################################################
# PRODUCTS
##########################################################
DELETE FROM `catalog_product_bundle_option`;
DELETE FROM `catalog_product_bundle_option_value`;
DELETE FROM `catalog_product_bundle_selection`;
DELETE FROM `catalog_product_entity_datetime`;
DELETE FROM `catalog_product_entity_decimal`;
DELETE FROM `catalog_product_entity_gallery`;
DELETE FROM `catalog_product_entity_int`;
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@cupracer
cupracer / varnishlog-examples.sh
Last active February 27, 2024 11:11
varnishlog examples (version 4.x)
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header