Skip to content

Instantly share code, notes, and snippets.

@monnoval
monnoval / passive-heatsink-with-external-mini-fan.png
Last active April 13, 2021 04:11
Raspberry Pi4 thermal data with passive heatsink
passive-heatsink-with-external-mini-fan.png
@monnoval
monnoval / openwrt-raspberry-pi4-nginx-php7-sqlite-wordpress.md
Last active May 13, 2021 03:16
Running OpenWrt + NGINX + PHP7 + SQLite + Wordpress in Raspberry Pi4

Run OpenWrt + Nginx + PHP7 + SQLite + Wordpress in Raspberry Pi4

* 13 May 2021
Broke my initial build due to a sys upgrade then re did all of below. Not sure what caused the problem. The main blockage I experienced is the expanding of the second partion, see here for the update.
* 18 April 2021
More or less complete by now, any updates or workarounds I will just keep on adding here
* 13-16 April 2021
Content for this post is still in progress as I'm compiling all the workarounds, fixes and commands for all this to work


@monnoval
monnoval / .htaccess
Created February 6, 2020 09:18
.htaccess for custom wp-content
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
git remote remove origin
git remote add origin [BASE-GIT-REPO]
git remote set-url --add --push origin [BASE-GIT-REPO]
git remote set-url --add --push origin [SECONDARY-GIT-REPO]
$ git remote -v
origin [BASE-GIT-REPO] (fetch)
@monnoval
monnoval / monnoval_rules.json
Last active December 3, 2019 07:57
Personal rules for karabiner
{
"title": "Personal rules (@monnoval)",
"rules": [
{
"description": "Right shift + a: Activity Monitor",
"manipulators": [
{
"type": "basic",
"description": "",
"from": {
#!/usr/bin/env bash
find . -type f \( -name "*.jpg" -o -name "*.jpeg" \) -print0 | xargs -0 mogrify -density 72 -set colorspace Gray -separate -average -strip -interlace Plane -gaussian-blur 10 -quality 1%
find . -name "*.png" -print0 | xargs -0 mogrify -density 72 -colors 4
#!/usr/bin/env bash
LOCAL=/Users/you/your/build-prod
REMOTE=/wp-content/themes/your-theme
WPE_HOST=sample.sftp.wpengine.com
WPE_USERNAME=sample-uname
WPE_PASSWORD=sample-pw
LFTP_CO="connect sftp://$WPE_USERNAME:$WPE_PASSWORD@$WPE_HOST:2222"
lftp << EOF
{"meta":{"version":"2.6.7","build":1497337039},"pods":{"5287":{"id":5287,"name":"blog","label":"Blog","description":"","type":"post_type","storage":"meta","object":"","alias":"","fields":[],"show_in_menu":"1","label_singular":"Blog","public":"1","show_ui":"1","supports_title":"1","supports_editor":"1","publicly_queryable":"1","exclude_from_search":"0","capability_type":"post","capability_type_custom":"blog","capability_type_extra":"1","has_archive":"0","hierarchical":"0","rewrite":"1","rewrite_with_front":"1","rewrite_feeds":"0","rewrite_pages":"1","query_var":"1","can_export":"1","default_status":"draft","supports_author":"1","supports_thumbnail":"1","supports_excerpt":"1","supports_trackbacks":"0","supports_custom_fields":"0","supports_comments":"0","supports_revisions":"1","supports_page_attributes":"0","supports_post_formats":"0","built_in_taxonomies_category":"0","built_in_taxonomies_link_category":"0","built_in_taxonomies_media_tag":"0","built_in_taxonomies_mediareleaseyear":"0","built_in_taxonomies_off
<script>
(function(d) {
var config = {
kitId: 'gdp2gpn',
scriptTimeout: 3000,
async: true
},
h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
})(document);
</script>
<optgroup label='All hotels'>
<option class='icon-hotel' data-is-hotel='true' data-url='http://www.holidayvillahotels.com/malaysia/kuala-lumpur/city-villa-kuala-lumpur' value='mykua25244'>
City Villa Kuala Lumpur
</option>
<option class='icon-hotel' data-is-hotel='true' data-url='http://www.holidayvillahotels.com/malaysia/cherating/eastern-pavilion-cherating' value='myche25242'>
Eastern Pavilion Boutique Resort &amp; Spa Cherating Pahang
</option>
<option class='icon-hotel' data-is-hotel='true' data-url='http://www.holidayvillahotels.com/malaysia/langkawi/federal-villa-langkawi' value='mylan25240'>
Federal Villa Beach Resort Langkawi Kedah
</option>