Skip to content

Instantly share code, notes, and snippets.

@olkitu
olkitu / cloudflare-firewall-examples.md
Last active Jul 24, 2021
CloudFlare firewall examples
View cloudflare-firewall-examples.md

Some example rules for CloudFlare firewall: https://developers.cloudflare.com/firewall/cf-firewall-rules/fields-and-expressions

Block access to Wordpress php-files

(http.request.uri.path contains "/wp-content/" and http.request.uri.path contains ".php") or (http.request.uri.path contains "/wp-includes/" and http.request.uri.path contains ".php") or (http.request.uri.path eq "/xmlrpc.php") or (http.request.uri.path contains "wp-config")

Block access to sensitive PHP-files

@olkitu
olkitu / docker-clean.sh
Last active Apr 15, 2021
Gitlab CI Docker Prune
View docker-clean.sh
#!/bin/bash
# Run this daily to cleanup unused images and networks
# chmod +x /etc/cron.daily/docker-clean.sh
# Create new log file
touch /var/log/docker-clean.log
# Delete all unused images and volumes
/usr/bin/docker system prune --volumes -a -f >> /var/log/docker-clean.log
@olkitu
olkitu / Enable5G_Samsung_Qualcomm.md
Last active Apr 6, 2021
Enable 5G on Samsung Qualcomm Devices
View Enable5G_Samsung_Qualcomm.md

This is tested Samsung Qualcomm phones S20/S21/Note20 Hong Kong and Taiwan versions.

  1. Prerequisities: You need to download and install Google Phone app from Google Play market (Phone by Google-Caller ID & Spam Protection)

  2. Dialer app by default: After the first launch, the application will ask you to make it the default dialer, confirm by selecting its blue icon from the list of available ones. You can return the native dialer after service menu manipulations (Settings - Apps - 3 dots in the upper right corner - Default apps - Phone)

  3. Activation of the service menu: Go to the Google Phone and dial *#*#27663368378#*#* for Android 10 or *#*#276633683782#*#* for Android 11. After pressing the last asterisk, the service menu will appear.

@olkitu
olkitu / OnePlus8_5G_Support.md
Last active May 30, 2021
OnePlus 8 and 8 Pro 5G-support 11.0.5.5
View OnePlus8_5G_Support.md

List of networks where 5G is enabled by default

Data is taken from OnePlus 8 11.0.5.5 Carrier Policy files. All OnePlus Unlocked models share same modem configurations but hardware supported combinations are different.

Check in cacombos.com site supported combinations:

8-model:

@olkitu
olkitu / OnePlus9_5G_Support.md
Last active Sep 13, 2021
OnePlus 9 and 9 Pro 5G-support 11.2.1.1.LE25 / 11.2.1.1.LE15
View OnePlus9_5G_Support.md
@olkitu
olkitu / docker-compose.yml
Last active Mar 20, 2021
DigitalOcean Metrics Agent on Docker Swarm (Tested RancherOS)
View docker-compose.yml
# docker stack deploy docker-compose.yml
version: "3.8"
services:
do-agent:
image: digitalocean/do-agent:stable
deploy:
mode: global
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
@olkitu
olkitu / ianmacd.json
Last active Jun 10, 2019
Magisk Repo for Sony X1
View ianmacd.json
{
"app": {
"version": "v7.0.1-2019032801-ianmacd",
"versionCode": "2019032801",
"link": "https://github.com/ianmacd/MagiskBuilds/raw/94eafcd8679c1590c14f8375c3c1a97c6f65c40b/MagiskManager-v7.0.1-2019032801-ianmacd.apk"
},
"magisk": {
"version": "18.2-2019032801-ianmacd",
"versionCode": "2019032801",
"link": "https://github.com/ianmacd/MagiskBuilds/raw/94eafcd8679c1590c14f8375c3c1a97c6f65c40b/Magisk-v18.2-2019032801-ianmacd.zip",
@olkitu
olkitu / Caddyfile
Last active May 18, 2019
Caddy WebServer configuration for Wordpress
View Caddyfile
example.org www.example.org {
tls username@example.org # Email for Let's Encrypt
root /var/www
gzip
fastcgi / /run/php/php7.2-fpm.sock php {
except /wp-content/upload
}
rewrite {
if {path} not_match ^\/wp-admin
if {path} not_match ^\/wp-includes
@olkitu
olkitu / functions.php
Created Mar 7, 2019
Hide WordPress version
View functions.php
<?php
remove_action('wp_head', 'wp_generator');
function wpbeginner_remove_version() {
return '';
}
add_filter('the_generator', 'wpbeginner_remove_version');
@olkitu
olkitu / .htaccess
Created Mar 7, 2019
Block access to PHP files on wp-content/upload, wp-content and wp-include directory
View .htaccess
<Files ~ "\.ph(?:p[345]?|t|tml)$">
deny from all
</Files>