Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@si458
si458 / virt-customize-ubuntu22
Last active February 17, 2024 01:06
virt-customize ubuntu22
#!/bin/sh
# install tools
apt update -y && apt install nano wget curl libguestfs-tools -y
# remove old image
rm -rfv ubuntu-22.04-server-cloudimg-amd64-disk-kvm.img
# remove old template container - WILL DESTROY COMPLETELY
qm destroy 9000 --destroy-unreferenced-disks 1 --purge 1
# download new image
wget http://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64-disk-kvm.img
# add agent to image
@Nielio
Nielio / compose.yml
Last active April 19, 2024 08:49
Gitlab CE with build in Container Registry behind Traefik 2 with Letsencrypt
version: "3.6"
services:
gitlab:
image: gitlab/gitlab-ce
volumes:
- gitlab-data:/var/opt/gitlab
- gitlab-logs:/var/log/gitlab
- gitlab-config:/etc/gitlab
networks:
- traefik-public

Removing a Mac's Firmware Password By Reflashing EFI ROM

According to Apple, the only way to remove an unknown firmware password from a MacBook (2011 and later) is to take it to the Apple Store with the original proof-of-purchase. However, I've found that there is another way, which I've been successful with for the unibody MacBook Pro--it's essentially just modifying a couple bytes in the EFI ROM, which should be simple. What's not simple, however, is figuring out how to read and write to the EFI chip. In this post, I'll talk about the process that I figured out and what worked for me.

The Official Method

Apple's method of resetting the firmware password is not reproducible, as Apple generates an SCBO file that unlocks the EFI using their private key. You can read more about this process here. The problem with this system is that, if you are in the unfortunate situation of neither having the firmware unlock pass

@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;
@matheusgontijo
matheusgontijo / magento-2-debugging-tricks-mysql-query-fetchall-fetchrow-data-hydrate-and-xdebug.php
Created June 10, 2019 01:00
Magento 2 Debugging Tricks - MySQL Query, fetchAll, fetchRow, Data Hydrate & PHP xDebug by Matheus Gontijo
Magento 2 Debugging Tricks - MySQL Query, fetchAll, fetchRow, Data Hydrate & PHP xDebug by Matheus Gontijo
Video: https://www.youtube.com/watch?v=xLf3OwpAFhQ
-----------------------------------------------
1) Track MySQL queries
vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php::query
vendor/magento/zendframework1/library/Zend/Db/Select.php
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
@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/

@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
@stecman
stecman / Makefile
Last active April 2, 2024 11:26
DS18B20 1-Wire implementation for Atmel AVR
DEVICE = atmega328p
CLOCK = 16000000
PROGRAMMER = -c arduino -P /dev/ttyUSB0 -b57600
AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE)
SOURCES = $(shell find . -name '*.c')
OBJECTS = $(SOURCES:.c=.o)
# Automatic dependency resolution
@marinsagovac
marinsagovac / Mailhog + Symfony 3
Last active March 29, 2021 19:37
Mailhog + Symfony 3
$message = \Swift_Message::newInstance()
->setSubject('Hello Email')
->setFrom('send@example.com')
->setTo('recipient@example.com')
->setBody('You should see me from the profiler!')
;
$this->get('mailer')->send($message);