Skip to content

Instantly share code, notes, and snippets.

@bsdnomad
bsdnomad / gist:a8158380d5900d836f285f2787fbbcd4
Created June 30, 2025 14:02 — forked from technoweenie/gist:1072829
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
_ _ _ ____ _ _
| | | | __ _ ___| | __ | __ ) __ _ ___| | _| |
| |_| |/ _` |/ __| |/ / | _ \ / _` |/ __| |/ / |
| _ | (_| | (__| < | |_) | (_| | (__| <|_|
|_| |_|\__,_|\___|_|\_\ |____/ \__,_|\___|_|\_(_)
A DIY Guide
@bsdnomad
bsdnomad / ddrescue.md
Created October 8, 2024 12:51 — forked from cetinajero/ddrescue.md
Guide for using Ddrescue to recover data

Guide for using Ddrescue to recover data

Start command:

ddrescue -d /dev/sda output.img output.mapfile

NOTE: If direct disc access is not available in your system, try raw devices.

@bsdnomad
bsdnomad / camerasettings.sh
Created May 3, 2024 13:08 — forked from justinledwards/camerasettings.sh
Camera settings on v4l2
#!/bin/bash
v4l2-ctl -c brightness=0
v4l2-ctl -c contrast=120
v4l2-ctl -c white_balance_temperature_auto=0
v4l2-ctl -c gamma=120
v4l2-ctl -c white_balance_temperature=4700
v4l2-ctl -c sharpness=100
v4l2-ctl -c backlight_compensation=0
v4l2-ctl -c focus_absolute=10
v4l2-ctl --list-ctrls-menus
@bsdnomad
bsdnomad / issue.md
Created March 26, 2024 14:53 — forked from erikhansen/issue.md
Amasty M2 Full Page Cache Warmer Issue - Submitted this issue to Amasty on 2019-12-11

I have a client using this extension, and we recently discovered a big performance issue.

Description: The query generated by the \Amasty\Fpc\Model\ResourceModel\Activity::matchUrl method runs a query on a table that is missing an index.

Here is a screenshot showing the slow query:

Slow query in New Relic

Once the client added a MySQL index for the table, the slow query went away:

@bsdnomad
bsdnomad / _bitbucket-git-downloader.sh
Created November 2, 2023 08:05 — forked from davidegironi/_bitbucket-git-downloader.sh
Script to download all repositories from a Bitbucket account
# Bitbucket Git Downloader
# Copyright (c) Davide Gironi, 2021
# Released under GPLv3
# Downloads all the repository from a Bitbucket account
@bsdnomad
bsdnomad / README.md
Created February 16, 2023 10:57 — forked from MrRio/README.md
Speed up your phpunit code coverage output in Laravel

Speed up your phpunit code coverage output in Laravel.

Your coverage reports are slowed down by xdebug tracing within Laravel and packages you depend on, despite them not being in your final coverage report. This moves the filtering from phpunit into xdebug itself.

Before: Time: 5.33 minutes, Memory: 10.00 MB

After: Time: 1.5 minutes, Memory: 10.00 MB

./vendor/bin/phpunit --coverage-html=results/coverage

@bsdnomad
bsdnomad / gist:280f2662f5785634f67e541c046fbb5f
Created February 1, 2023 11:25 — forked from vxnick/gist:380904
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
@bsdnomad
bsdnomad / cashier.php
Created January 31, 2023 14:52 — forked from Braunson/cashier.php
Extending the Laravel package Cashier for creating an customer without a credit card
namespace Acme\V1\Billing;
// BillableInterface.php
use Laravel\Cashier\BillableInterface as CashierInterface;
interface BillableInterface extends CashierInterface {
}
@bsdnomad
bsdnomad / .jshintrc
Created May 18, 2022 14:17 — forked from bolshchikov/.jshintrc
JSHint configuration file
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
// == Enforcing Options ===============================================
//
// These options tell JSHint to be more strict towards your code. Use
// them if you want to allow only a safe subset of JavaScript, very