Skip to content

Instantly share code, notes, and snippets.

@blazewicz
blazewicz / docker-compose-install.sh
Last active January 4, 2024 18:14
Install latest docker-compose on Debian, Ubuntu or Raspberry Pi OS (Raspbian)
#!/bin/bash
set -x
# This script with documentation is available at: https://gist.github.com/blazewicz/04e666ae1f25387c8b291d81b12c550c
## 1. install required dependencies with apt
apt update && apt install python3-venv python3-dev libffi-dev libssl-dev
## 2. create directory for docker-compose's virtualenv
mkdir -p /opt/local/docker-compose
@debold
debold / Enable-NET-TLS12.reg
Created December 22, 2019 13:27
Enable TLS 1.2 for .NET Framework
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v2.0.50727]
"SystemDefaultTlsVersions"=dword:00000001
"SchUseStrongCrypto"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319]
"SystemDefaultTlsVersions"=dword:00000001
"SchUseStrongCrypto"=dword:00000001
git_current_branch () {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]
then
[[ $ret == 128 ]] && return
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
#!/usr/bin/perl
# This file was written as an executable to be used in the auto report function
# of csf and lfd. By replacing $YOUR_API_KEY below with your abuseipdb api key,
# allows you to use this code to integrate your csf system with abuseipdb.com
use strict;
use warnings;
use HTTP::Tiny;
use JSON;
# Gather the information from the commandline passed by lfd
@WganMe
WganMe / ffmpeg cPanel
Last active July 2, 2020 06:44
ffmpeg cPanel
cd /usr/local/src/
wget http://rep0.admin-ahead.com/sources/aast-ffmpeg-installer/2_0_4/sources/ffmpeg-php.tar.gz
tar zxvf ffmpeg-php.tar.gz
cd ffmpeg-php
/opt/cpanel/ea-php56/root/usr/bin/phpize
CFLAGS=-I/usr/local/ffmpeg/build/include LDFLAGS=-L/usr/local/ffmpeg/build/lib ./configure --with-ffmpeg=/usr/local/ffmpeg/build/ --with-php-config=/opt/cpanel/ea-php56/root/usr/bin/php-config
make && make install
echo "extension=ffmpeg.so" >> /opt/cpanel/ea-php56/root/etc/php.d/ffmpeg.ini
/opt/cpanel/ea-php70/root/usr/bin/phpize
CFLAGS=-I/usr/local/ffmpeg/build/include LDFLAGS=-L/usr/local/ffmpeg/build/lib ./configure --with-ffmpeg=/usr/local/ffmpeg/build/ --with-php-config=/opt/cpanel/ea-php70/root/usr/bin/php-config
@ghostbear
ghostbear / Spotify - How to reduce and limit the cache size (Windows - Mac).md
Last active May 12, 2024 23:04
[Spotify] How to limit the cache size (Windows/Mac OS)

Credit to MadHatter

WINDOWS

Use your text editor of choice or if you don't have one use Windows Notepad
Opening with Notepad may or may not result in a fancy mess

  1. Close Spotify
  2. Open File Explorer and paste the following into the address bar %appdata%/Spotify¤
  3. Open the file named prefs with your text editor
  4. Change the numeric value following storage.size= . If storage.size= doesn't exist add it manually to the end of the file and assign numeric value. This value represents megabytes. One gigabyte equals 1024 megabytes. In the end, it should look something like this storage.size=1024
  5. Save the file
@Bharat-B
Bharat-B / hostname.conf
Created February 23, 2018 08:22
WHMCS nGINX rules for SSL / Non SSL
### NON SSL | STANDARD HTTP
server {
listen 80;
server_name domain.com;
root /path/to/whmcs;
index index.php index.html;
access_log /var/log/nginx/domain.com.log combined;
access_log /var/log/nginx/domain.com.bytes bytes;
error_log /var/log/nginx/domain.com.error.log error;
location / {
@RomelSan
RomelSan / Powershell-Certificates-BRIEF.ps1
Last active May 2, 2024 02:43
Powershell Self Signed Certificate
#-------------------------------------------------------------------------------------
# Create Self signed root certificate
# -dnsname -DnsName domain.example.com,anothersubdomain.example.com
# -Subject "CN=Patti Fuller,OU=UserAccounts,DC=corp,DC=contoso,DC=com"
$cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature `
-Subject "CN=P2SRootCert" `
-KeyExportPolicy Exportable `
-HashAlgorithm sha256 -KeyLength 4096 `
-CertStoreLocation "Cert:\CurrentUser\My" `
-KeyUsageProperty Sign `
@lenosi
lenosi / README.md
Created November 7, 2017 21:17
How to use Python 3.x on RHEL/CentOS 6.x

Using Software Collections

RHEL 6.x

$ yum-config-manager --enable rhel-server-rhscl-6-rpms
$ yum-config-manager --enable rhel-server-rhscl-beta-7-rpms
$ yum install rh-python36 # Or rh-python37

CentOS 6.x

@TODO