Skip to content

Instantly share code, notes, and snippets.

View danie1k's full-sized avatar
Automate! Automate everything!...

Daniel Kuruc danie1k

Automate! Automate everything!...
View GitHub Profile
danie1k / user-style.css
Last active January 28, 2021 16:33
BitBucket New Style Pull Request view user-style
.sc-jtRlXQ {
padding-left: 2.5rem;
/* background */
.sc-fOICqy {
border-radius: 24px 16px 16px 16px;
border: 1px solid #fff;
margin-right: -1px;
margin-bottom: -1px;
danie1k / Cargo.toml
Last active February 4, 2020 21:56
Simplest Rust Qt5 "Hello World" example
name = "hello_world"
version = "0.1.0"
edition = "2018"
qt_core = "*"
qt_gui = "*"
qt_widgets = "*"
danie1k /
Created October 17, 2019 21:42
Update QNAP SSL Certificate via CLI
#!/usr/bin/env sh
set -e
# Based on
# FYI: Assuming, that cert files are present and named: cert.key & cert.cert
scp -P $SSH_PORT cert.key $SSH_STRING:/etc/stunnel/backup.key &>/dev/null
danie1k /
Last active September 11, 2023 22:10
Export SSL Certificate from OPNsense to file
#!/usr/bin/env sh
# Based on
echo "Downloading certificate id=${CERT_ID} from ${HOSTNAME} into cert.pem file..."
#!/usr/bin/env bash
tarBranch=$(git branch -r --merged | grep -v master | grep -v develop | sed 's/origin\///')
for branch in $tarBranch
echo "Branch: $branch"
lastDate=$(git show -s --format=%ci origin/$branch)
convertDate=$(echo $lastDate | cut -d' ' -f 1)
Todate=$(date -d "$convertDate" +'%s')
current=$(date +'%s')
danie1k /
Created September 29, 2017 09:15
Total recursive dict len counter
def _counter(d):
# how many keys do we have?
yield len(d)
# stream the key counts of our children
for v in iter(d.values()):
if isinstance(v, dict):
csv exporter
* in your admin class for model, insert: actions = [ download_as_csv_view ]
* add columns names in HEADER
* add data columns in _make_csv_row
:copyright: (c)
danie1k / removeOrders.sql
Last active December 14, 2015 07:28
Remove all orders from Magento
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_order`;
danie1k / removeProducts.sql
Last active January 27, 2016 11:51
Remove all Products from Magento
TRUNCATE TABLE `catalog_product_bundle_option`;
TRUNCATE TABLE `catalog_product_bundle_option_value`;
TRUNCATE TABLE `catalog_product_bundle_selection`;
TRUNCATE TABLE `catalog_product_entity_datetime`;
TRUNCATE TABLE `catalog_product_entity_decimal`;
TRUNCATE TABLE `catalog_product_entity_gallery`;
TRUNCATE TABLE `catalog_product_entity_int`;
TRUNCATE TABLE `catalog_product_entity_media_gallery`;
TRUNCATE TABLE `catalog_product_entity_media_gallery_value`;