Skip to content

Instantly share code, notes, and snippets.

@beastycoding
beastycoding / sysctl-conf.sh
Created November 2, 2018 19:42 — forked from trajakovic/sysctl-conf.sh
High performance sysctl.conf
#!/bin/bash
#check if this script is running in su mode
func_check_for_root() {
if [ ! $( id -u ) -eq 0 ]; then
echo "ERROR: $0 Must be run as root, Script terminating" ;exit 7
fi
}
func_check_for_root
@beastycoding
beastycoding / updateJetbrains.sh
Created November 2, 2018 19:43 — forked from danielcosta/updateJetbrains.sh
Script to update PhpStorm and others Jetbrains products
#!/usr/bin/env bash
VERSION_PATTERN="([0-9]+\.[0-9]+\.[0-9]+)"
case "${1}" in
"phpstorm")
TOOL_NAME="PhpStorm"
INSTALL_DIR="/opt/phpstorm"
case "${2}" in
"eap")
@beastycoding
beastycoding / rfc3161.txt
Created January 22, 2021 15:30 — forked from Manouchehri/rfc3161.txt
List of free rfc3161 servers.
http://timestamp.globalsign.com/scripts/timstamp.dll
http://timestamp.globalsign.com/?signature=sha2
http://rfc3161timestamp.globalsign.com/advanced
https://timestamp.geotrust.com/tsa
http://timestamp.sectigo.com
http://timestamp.wosign.com
http://tsa.startssl.com/rfc3161
http://time.certum.pl
http://timestamp.digicert.com
https://freetsa.org
@beastycoding
beastycoding / export-node-stats.md
Created September 22, 2022 10:17 — forked from ScriptingSquirrel/export-node-stats.md
Setup prometheus-node-exporter and push stats to Pushgateway with cron job

(Assuming a Debian 8-like system)

  • Install prometheus-node-exporter

    $ sudo apt update && sudo apt install prometheus-node-exporter
  • Configure prometheus-node-exporter to expose metrics only to localhost, not on to all networks. Modify file /etc/default/prometheus-node-exporter:

    # Set the command-line arguments to pass to the server.
@beastycoding
beastycoding / .htaccess
Created January 7, 2023 14:46 — forked from Zodiac1978/.htaccess
Make your Website faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
# https://andreashecht-blog.de/4183/
@beastycoding
beastycoding / setup.md
Created January 12, 2023 20:10 — forked from ibqn/setup.md
Setup VSCode with Live Server and a Docker container

Setup VSCode with Live Server and a Docker container

In this I will shortly describe how to setup

I used a docker-compose.yml file although I only created one container with no other dependencies. This works with a regular Dockerfile as well.

@beastycoding
beastycoding / upload-a-file.MD
Created January 16, 2023 22:06 — forked from ahmadawais/upload-a-file.MD
Upload a file using the WordPress REST API

Upload files

Using the REST API to upload a file to WordPress is quite simple. All you need is to send the file in a POST-Request to the wp/v2/media route.

There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:

@beastycoding
beastycoding / README.md
Created January 17, 2023 15:25 — forked from kabili207/Rclone systemd service.md
Rclone systemd user service

rclone systemd service

Preparation

This service will use the same remote name you specified when using rclone config create. If you haven't done that yet, do so now.

Next, create the mountpoint for your remote. The service uses the location ~/mnt/<remote> by default.

mkdir ~/mnt/dropbox
@beastycoding
beastycoding / debian-fullscreen-in-hyperv.md
Created January 25, 2023 18:55 — forked from robert-claypool/debian-fullscreen-in-hyperv.md
How To Make Debian Linux Fullscreen in Hyper-V
@beastycoding
beastycoding / Ubuntu_on_Hyper-V.md
Created January 26, 2023 05:43 — forked from deoren/Ubuntu_on_Hyper-V.md
Ubuntu on Hyper-V

Enabling full Hyper-V support for Ubuntu

Install packages

Short version: See docs.microsoft.com link below.

Ubuntu 17.04 and later

  1. sudo apt-get update
  2. sudo apt-get install linux-image-virtual linux-tools-virtual linux-cloud-tools-virtual