Skip to content

Instantly share code, notes, and snippets.

@danpawlik
danpawlik / clean-up-xiaomi-bloatware.sh
Last active November 14, 2024 09:46 — forked from davydes/clean-up-xiaomi-bloatware.sh
Cleanup apps installed in MIUI
#!/bin/sh
#
# Clean-up Xiaomi smartphone without rooting:
#
# 1) You have to install adb tool from android sdk
# 2) You have to activate developer options, next activate usb debugging
# 3) Comment out or delete lines with packages, if you really need them
# 4) Optional: I hightly recommed to activate OEM unlocking feature in developer options.
# It doesn't unlock you device immediately, but in case of breaking you phone
# you will have opportunity to unlock you phone and reflash it via MiFlash.
@spidgorny
spidgorny / TailLog.php
Created July 9, 2021 19:27
Display only the last error from the Laravel log file and simplify output so that it fits the single screen output. Like "tail -f storage/logs/laravel.log", but smart
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
class TailLog extends Command
{
/**
@janisblaus
janisblaus / gist:fd13210dc2d61bf53e432010ce37c329
Created February 25, 2021 20:25
Fix Grub ♥ on OVH nvme disks, software RAID | Centos
mount /dev/md2 /mnt
mount /dev/nvme0n1p1 /mnt/boot/efi
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
@s3rj1k
s3rj1k / HowTo
Last active September 5, 2024 13:53
Ubuntu 20.04.3 AutoInstall
# For recent versions of Ubuntu:
- https://www.pugetsystems.com/labs/hpc/ubuntu-22-04-server-autoinstall-iso/
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer:
@Braunson
Braunson / pivot-tables.md
Last active May 15, 2024 08:12
Laravel 8.x - Diving into Pivot Tables

Laravel 6 - Diving Into Pivot Tables

Pivot tables can be confusing and a little hard to wrap your head around at first. In this quick article we are going to dive into what a pivot table is, how to create one and finally how to use the pivot table. Let's dive in!

What is a pivot table?

A pivot table is used to connect relationships between two tables. Laravel provides a Many To Many relationship where you can use a pivot table.

@kfsone
kfsone / zeroconfdump.py
Created January 27, 2019 06:18
Dumps a list of all zeroconf devices on the network
#! /usr/bin/env python
# requires zeroconf (e.g. pip install --user zeroconf)
from collections import defaultdict
from time import sleep
from zeroconf import Zeroconf, ServiceBrowser, ZeroconfServiceTypes
from json import dumps
verbose = False
@fnky
fnky / ANSI.md
Last active November 16, 2024 21:14
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active November 14, 2024 06:21
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@tidus2102
tidus2102 / gist:d752910155ba77e7ff56f375122de73e
Created November 10, 2017 09:52
CentOS 7 PHP Deployment
0.
yum -y install epel-release yum-utils
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum-config-manager --enable remi
yum-config-manager --enable remi-php71
yum clean all
yum -y update
nano /etc/selinux/config
@BigNerd95
BigNerd95 / glddnsupdater.sh
Last active October 14, 2024 07:01
GL.iNet ddns update script [will associate your wan IP to puXXXXX.gl-inet.com where XXXXX are the latest 5 bytes of the mac address]
#!/bin/sh
# OpenWRT support libs
. /lib/functions.sh
. /lib/functions/network.sh
. /usr/share/libubox/jshn.sh
ip_regex="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"
ddns=
code=