This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Patch log4shell | |
hosts: all | |
remote_user: root | |
tasks: | |
- name: Ensure find, lsof, kill, zip, unzip, coreutils and gawk are installed | |
apt: | |
name: "{{ packages }}" | |
state: present | |
vars: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check the amount of CPU being consumed by processes other than xmrig | |
# Takes a single (optional) argument, the name of the screen to target. Defaults to "xmrig" if unspecified | |
set -e | |
#12.5% or 2 full cores (with our 16 total) | |
IDLE_THRESHOLD=12.5 | |
TARGET_SCREEN="${1:-xmrig}" | |
NUM_CORES=$(cat /proc/cpuinfo | grep "core id" | wc -l) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Convert 2160p to 1440p | |
import sys | |
import os | |
from os.path import join, getsize, dirname, basename | |
from subprocess import run, PIPE, STDOUT | |
from time import sleep | |
from collections import namedtuple | |
FFPROBE_BIN = os.getenv('FFPROBE_BINARY', 'ffprobe') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# names of latest versions of each package | |
export NGINX_VERSION=1.13.1 | |
export VERSION_PCRE=pcre-8.40 | |
export VERSION_LIBRESSL=libressl-2.5.4 | |
export VERSION_NGINX=nginx-$NGINX_VERSION | |
#export NPS_VERSION=1.9.32.10 | |
#export VERSION_PAGESPEED=v${NPS_VERSION}-beta | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Top-like script for MySQL | |
DELAY=2 | |
TTY_WIDTH=$(($(stty size | awk '{print $2}')-6)) # determine terminal width | |
TTY_HEIGHT=$(($(stty size | awk '{print $1}')-6)) # determine terminal height | |
while true; do | |
content="Status:\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get a copy of the linux kernel source you intend to build | |
Install u-boot-tools, gcc-aarch64-linux-gnu, g++-aarch64-linux-gnu device-tree-compiler libncurses-dev (packages names on debian-based systems) | |
You also need native compiler tools available, such as build-essential | |
Add the following to arch/arm64/boot/dts/allwinner/Makefile: | |
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb | |
If they allwinner folder doesn't exist, get the patches necessary to create it (and its friends) from mainline kernel, linux-sunxi, etc, etc | |
Add the attached dts, dtsi and defconfig files to the locations specified below: | |
dts & dtsi --> arch/arm64/boot/dts/allwinner/ | |
defconfig --> arch/arm64/config/ | |
Run the following (from the root of the kernel tree): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Simple Magento backup script by Nicka101 <nicka101@cloudbro.net> | |
# Some configuration constants | |
DB_NAME="<YOUR DB NAME>" | |
AZURE_USERNAME="<YOUR AZURE USERNAME>" | |
AZURE_KEY="<YOUR AZURE KEY>" | |
AZURE_CONTAINER="<YOUR (EXISTING) AZURE CONTAINER>" | |
WEBDIR=/var/www/whatever-folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('app/Mage.php'); | |
Mage::app(); | |
$attrib = Mage::getSingleton('eav/config')->getAttribute('customer', 'sinch_pricerules_group'); | |
$attrib->setData('used_in_forms', array('adminhtml_customer')); | |
$attrib->save(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('app/Mage.php'); | |
Mage::app(); | |
$ftpCred = Mage::getStoreConfig('sinchimport_root/sinch_ftp'); | |
Mage::dispatchEvent('sinch_pricerules_import_ftp', array( | |
'ftp_host' => $ftpCred["ftp_server"], | |
'ftp_username' => $ftpCred["login"], | |
'ftp_password' => $ftpCred["password"] | |
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <iostream> | |
#ifdef _WIN32 | |
#include <WS2tcpip.h> | |
#define LAST_ERR WSAGetLastError() | |
#define SOCK_INVALID(s) s == INVALID_SOCKET | |
#else | |
#define LAST_ERR errno | |
#define SOCK_INVALID(s) s < 0 | |
#include <sys/socket.h> |
NewerOlder