How to clear your proxy’s cache, without fastcgi_cache_purge

Didn’t know that module was free, the paid NGINX has something that does that. Use NGINX Helper, and set it to URL, then use fcgiwrap. Change the user and group it runs as to whatever nginx is, it’s a cache, so there’s nothing to hack. If using Debian, edit the fcgiwrap.service file. You might need to edit /etc/init.d/fcgiwrap too.

Clicking Purge Cache won’t work with the NGINX Helper plugin. Posting will clear the cache. There’s nothing in my logs about it accessing the URL when clicking purge. I think purge isn’t using a GET request, it’s trying to delete the contents of the cache folder, I deleted it on the non proxy/cache and the errors went away. Was getting permission denied. You’d have to edit it, to tell it to use GET for the Purge Cache option.

Add the below to your /etc/nginx/sites-enabled/default:

        location ~ /purge(/.*) {
		 gzip off;
	         fastcgi_pass unix:/var/run/fcgiwrap.socket;
    		 include /etc/nginx/fastcgi_params;
    		 fastcgi_param DOCUMENT_ROOT /var/www/html;
    		 fastcgi_param SCRIPT_FILENAME /var/www/html/;

And the /var/www/html/ file:

echo "HTTP/1.0 200 OK\r\n"
rm -fr /var/www/nginx_cache/*

Probably better to use the fastcgi_cache_purge module. Instructions for that module here.

It will be slow when posting if you do that too.

You might want to add “deny all;” and “allow ip;” to the NGINX config file. For the purge location. Just allow whatever the main VPS’s IP is, the backend. If it’s all running on the same server, then use

If you edit the plugin, and make it only access one URL, clearing might be faster. I assume it’s accessing a bunch of purge URLs, which is pointless with that shell script. All the URLS do the same thing.

How to speed up compiling in Manjaro or Arch Linux with a AMD Ryzen CPU

Edit /etc/makepkg.conf. That is assuming you are using makepkg.

Add “MAKEFLAGS=’-j17′” to it.

And be amazed at how fast it compiles stuff.

Did it take less then 10 minutes? If so, it was well worth the money.

And I have to restart, because they haven’t updated the PKGBUILD, you have to rename something. I waited for ten minutes or less for nothing.

Recompiling didn’t take long. Don’t think it actually recompiled.

How to fix Jetpack if using NGINX as a proxy

Add “set_real_ip_from;” on the backend, to the nginx.conf file. Under http. Replace the IP with the proxy’s IP. Stolen from here.

Editing wp-config.php with their hack, didn’t work for whatever reason.

if ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
  $forwarded_ips = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
  $_SERVER['REMOTE_ADDR'] = $forwarded_ips[0];
  unset( $forwarded_ips );

You can try that if you can’t change your web server’s config.

Just realized, fastcgi might of cached it. So purging the cache, could of made the wp-config.php hack work. I also tried changing it to the X-Real-IP header.

You can upgrade to Android 7/EMUI 5 before it says there’s an update

My internet is slow, still downloading the zip files. B360 B360

The file was found here, and the URL was modified for the

If using Linux, you can use mitmproxy. Or you can use Charles Proxy, instructions here.

Don’t know how to do it in mitmproxy, if it only shows stuff, but doesn’t allow you to change anything, then it won’t work.

Wait a second, why do you have to download it manually? Think somebody said you don’t.

The B60 response is below.

"status": "0",
"autoPollingCycle": "1",
"components": [{
"name": "FRD-L04C567B360-OTA",
"version": "FRD-L04C567B360",
"versionID": "72309",
"description": "å• †ç”¨å‘布: [全量包] FRD-L04C567B162 至 FRD-L04C567B360 (2017/01/03)",
"createTime": "2017-01-03T03:18:12+0000",
"url": ""

Good luck using mitmproxy. You might have to write a script.

The script finally works.

This example shows how to send a reply from the proxy immediately
without sending any data to the remote server.
from mitmproxy import http
import json
class Honor_Updater:
	def __init__(self):
		with open('update.txt') as data_file:    
			self.json = json.load(data_file)	
	def request(self, flow):
		# pretty_url takes the "Host" header of the request into account, which
		# is useful in transparent mode where we usually only have the IP otherwise.
		if flow.request.pretty_url == "":
			flow.response = http.HTTPResponse.make(
				200,  # (optional) status code
				str(self.json).encode("utf8"),  # (optional) content
				{"Content-Type": "application/json"}  # (optional) headers
def start():
    return Honor_Updater()

That’ll let you update your Honor 8. To use type mitmdump -s “” -p 8080, then use your computer as a proxy on your phone, go to WiFi, then touch the network until you get a popup. Modify the network.

I forgot to disconnect from the proxy, so I had to reboot my phone.

And it’s downloading, sweet.

Oh yeah, put the below in a file called update.txt.

"status": "0",
"autoPollingCycle": "1",
"components": [{
"name": "FRD-L04C567B360-OTA",
"version": "FRD-L04C567B360",
"versionID": "72309",
"description": "å• †ç”¨å‘布: [全量包] FRD-L04C567B162 至 FRD-L04C567B360 (2017/01/03)",
"createTime": "2017-01-03T03:18:12+0000",
"url": ""

In the same folder as

See, you don’t need a paid program to do it. Just Linux.

If you forget to disable the proxy, before clicking update, just reboot, and it’ll start downloading as soon as it boots up.

You can download the script and the txt file below.

You can get mitmproxy for Windows too.

How to use the NVIDIA driver with a PCIe x1 710 and a AMD video card in the first PCIe x16 slot

Install the NVIDIA driver, “sudo mhwd -i pci video-nvidia”.

Then edit /etc/mkinitcpio.conf, remove “nouveau” from the MODULES line.

Then run “sudo mkinitcpio -p linux48”, change 48 to the version of your kernel, 44 is the default that comes with Manjaro.

Look in the /etc/X11/mhwd.d/nouveau.conf file, you need the BusID line.

Add BusID “PCI:5:0:0” or whatever your BusID line is, to the /etc/X11/mhwd.d/nvidia.conf. It goes in the Device section, under Driver “nvidia”.

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    BusID       "PCI:5:0:0"
    VendorName     "NVIDIA Corporation"
	Option "NoLogo" "1"

Then reboot, and it should work.

This assumes you already blacklisted the amdgpu driver.

How to passthrough the video card in your main PCIe x16 slot to a QEMU virtual machine

Not for using a single video card, I put a cheap NVIDIA PCIe x1 card in my computer. You use the NVIDIA with Linux, and the AMD for Windows.

Using the integrated GPU isn’t the solution, no overclocking if you do that. Except, you get no sensor data if overclocking a non K series Intel CPU.

If both cards, are the same brand, I can’t help you. Also, you should already have the PCIe x1 card working.

Upgrading the kernel may or may not be needed. I’d use at least 4.8. I did upgrade, but I don’t think that’s what fixed it.

You need to edit /etc/default/grub:

iommu=pt intel_iommu=on modprobe.blacklist=amdgpu video=efifb:off

Add that to the “GRUB_CMDLINE_LINUX_DEFAULT=” line.

Then run sudo update-grub.

Assuming you are using libvirt, add the below to the section for your video card, in the /etc/libvirt/qemu/win10.xml file.

<rom file='/home/user/Downloads/MSI.RX470.4096.160818.rom' />

The full section in my xml file looks like the below:

    <hostdev mode='subsystem' type='pci' managed='yes'>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      <rom file='/home/user/Downloads/MSI.RX470.4096.160818.rom' />
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>

If you upgraded the kernel, you’ll need to remove your USB devices and the video card, and re add everything, otherwise you’ll get an error. Also, you might need to change the CPU.

You can find the ROM file for your video card here. Or you can boot Windows, and use GPU-Z and get it from that.

VGA passthrough didn’t work with whatever kernel Manjaro uses by default. Even with the integrated video.

Might be easier if your bios lets you specify which PCIe card is the primary card. My bios only has integrated or PCIe. No way to say which card to boot from. It boots from the AMD card, so if I need to enter the bios, I have to change the input on my monitor.

I assume, you already had VGA passthrough working. If not, you can go to Arch Linux’s Wiki, or search Google.

How to send Windows audio to your Linux computer over the network

Are you using Windows in a KVM virtual machine? You might notice the CPU usage is high if you use KVM’s audio. Use Stream What You Hear, it’s free. Install it in Windows, and then use VLC or any other media player, to play the stream, or you can try setting up UPnP/DLNA.

There is a delay, at least in the HTTP streaming. I don’t really care. Better then using a USB sound card, plugged into my computer’s internal sound card’s line in port. Doesn’t sound that great, and if there’s no audio, you can hear a noise like your ear’s ringing.

Airfoil Speakers doesn’t work in Manjaro. Gets a nice error message and closes, probably because it was written with an old version of Mono. I’m not installing an old Ubuntu version to use it. Also, it costs 30 bucks. If they can’t make a working Linux speaker program, then I’m not buying the Windows software.

You have to have a sound card for it to work, my HDMI sound from my AMD video card doesn’t work for some reason. So I had to plug the damn USB sound card back in. Didn’t work plugged into my USB 3.0 hub. Had to plug it in on the back of my computer, where it was. The keyboard for some reason didn’t work with the USB sound card plugged into the hub. So I couldn’t login.

A media renderer might be worse. I compiled gmrender-resurrect. Instructions for an old Ubuntu here. If using Manjaro, you only need to install gstreamer0.10-ffmpeg, it’ll compile without it, but it won’t work. Easier then manually running VLC. So I’ll use it.

Don’t use gmrender-resurrect. It is choppy. VLC works better, using an HTTP stream. Also, you have to try connecting, won’t work, disconnect, connect again, and it’ll work. So, you might not need ffmpeg. Or maybe recompiling with ffmpeg installed makes it work better. I’ll just use VLC.

The Stream What You Hear might be what’s choppy. The HTTP stream was having issues too. Restarted Stream What You Hear, and it might be better.

How to make a Ubuntu chroot in Arch Linux or Manjaro Linux

Use debootstrap.

sudo pacman -S debootstrap

Don’t follow the instructions on Ubuntu’s site, their deboostrap doesn’t work with Manjaro Linux or Arch Linux.

sudo debootstrap --variant=buildd --arch amd64 trusty /ubuntu

That’s the command I just used, Airfoil Speakers probably requires an old Ubuntu version. I tried the newer version the first time.

mount -o bind /dev /ubuntu/dev
mount -o bind /proc /ubuntu/proc
mount -o bind /sys /ubuntu/sys
chroot /ubuntu

Then after you are in, run “export PATH=”$PATH:/usr/sbin:/sbin:/bin””. Then install nano, and put that in the /etc/profile file.

Good luck, you need a virtual machine for Airfoil Speakers.

If compiling Mono GIT doesn’t work, then I give up. No audio in Windows for me. Screw that, use Stream What You Hear.

It’ll give you an URL, that you can play in VLC. Don’t need to install anything to do that, VLC already is.

It works, and it might have a delay, which is a bummer. Good enough.

Convert Windows 1Password 6 txt file to generic CSV file for importing in LastPass

The script finally works. Don’t try to use math to get the website address, I think every exported entry has a website=, so you don’t have to be smart to figure out which line website is on.

s = "url,type,username,password,hostname,extra,name,grouping\n"
users = []
pass = []
hostname = []
namey = []
tn = 0
stuff = [][0], "r") {|f|
	f.each_line do |line|
		if line.start_with?("\r")
			tn = tn + 1
			if stuff[tn].nil?
				stuff[tn] = line.to_s
				stuff[tn] += line.to_s
stuff.each { | itemy | 
	if !itemy.nil?
		t = []
		t = itemy.split(/\n/)
		en = t.count - 1
		n = 0
		if t
			t.each { | bla |
				t2 = bla.split("=", 2)
				diff = en - n
				t2[0] = t2[0].to_s.gsub(/\r|\n/m, "")
				t2[1] = t2[1].to_s.gsub(/\r|\n/m, "")
				if n != 0
					if diff == 1 && t2[0] != "password"
						users[stuff.index(itemy)] = t2[1]
					elsif en == n && t2[0] != "username"
						pass[stuff.index(itemy)] = t2[1]
					elsif t2[0] == "website"
						hostname[stuff.index(itemy)] = t2[1]
					elsif n == 1
						namey[stuff.index(itemy)] = t2[1]
			n = n + 1
n = 0
while n <= tn do
	if hostname[n].nil?
		if pass[n] == pass[n - 1]
			hostname[n] = hostname[n - 1]
			namey[n] = namey[n - 1]
	if "#{hostname[n]},,#{users[n]},#{pass[n]},#{hostname[n]},,#{namey[n]}," != ",,,,,,,"
		s += "#{hostname[n]},,#{users[n]},#{pass[n]},#{hostname[n]},,#{namey[n]},"
		s += "\n"
	n = n + 1
end[1], "w") {|f|
print "Saved #{tn} to #{ARGV[1]}\n"

There’s the Ruby script to convert it. If it doesn’t work, you can fix it. If you run it in Windows, use Bash. Or find a Windows build of Ruby.

Had to change my dediserve password, the password I imported didn’t work. I deleted the txt file already, so I can’t see what it is in there. Also uninstalled 1Password, and I’m not in Windows.

Don’t use that script, Amazon password is wrong too. Has instead of a password. Another password to reset.

No cPanel login for my BuyShared hosting. Tried resetting, but no email yet.

Don’t use BuyShared, if you might lose the password. I had to go into Windows, and login to 1Password in Chrome, and copy the password. BuyShared disabled all email apparently.

The script doesn’t like certain characters. You could try removing the .to_s.gsub.

LastPass’s password generator blows. The password I copied and pasted, is wrong, can’t login.

Updated the code to limit the split to 2. That might fix it. I’m assuming the passwords that aren’t all there, have an equals sign.

Sound finally works

You have to change a setting in /etc/libvirt/qemu.conf, change the host audio or whatever it’s called to 1. Then change the xml file. You have to add four environment variables to it.


Can’t remember the location of the XML file. But to add custom environment variables, instructions here. Those variables were stolen from Linux Mint’s forum.