RF Eclectica Wiki

Try to learn something about everything, and everything about something - Thomas Huxley

User Tools

Site Tools


public:computers:gists

02 : Computers

Code & Command Snippets

Windows WiFi Disconnect

Windows will disconnect a WIFI connection when it discovers there's no WAN internet - presumably Windows thinks ALL networks are connected to the Internet and this prevents using WIFI for an isolated LAN, and also throws you off the WLAN whenever the ADSL connection fails, even when you're busy using only internal LAN sessions.

THIS IS WRONG BEHAVIOUR.

I found a solution, and typically it's a REGEDIT task:

From : https://superuser.com/questions/1650052/how-to-keep-windows-10-connected-to-wifi-without-internet

Add a Registry DWORD “NoActiveProbe” value “1” at Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkConnectivityStatusIndicator

Job Done. You stay on your LAN even when the interwebs is down.

Chrome redirects

To remove a “permanent redirect” - e.g. from an http to an https URL - I found the answer here:

https://www.neilwithdata.com/chrome-redirect-forget

  • Open the Chrome Developer Tools (F12)
  • Go to the Network tab and make sure Disable cache is ticked
  • Reload (or navigate to) the page you no longer want to be redirected while keeping the dev tools open.

John Pumford-Green 27/04/23 06:12

Vim Pasting

I recently had problems pasting text into Vim by the traditional RIGHT click method. Vim would enter Insert(VISUAL) mode instead.

One solution when using Putty is to use its own mechanism :

SHIFT+INS

I prefer to use RIGHT click, as it's more natural so I found the solution is to add

set mouse-=a

to ~/.vimrc

This solves the problem, and I don't need to use nano when editing text files on my remote server via SSH using Putty.

Raspberry Pi Stuff

  • find Raspberry Pi Model : cat /sys/firmware/devicetree/base/model
  • mount a raspberry pi image
gm4slv@laptop:~/piimg $ sudo losetup -Pf igate.img
gm4slv@laptop:~/piimg $ lsblk
NAME      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0       7:0    0   4.3G  0 loop
├─loop0p1 259:0    0   256M  0 part
└─loop0p2 259:1    0     4G  0 part
sda         8:0    0 298.1G  0 disk
├─sda1      8:1    0 235.1G  0 part /
├─sda2      8:2    0     1K  0 part
├─sda3      8:3    0  50.9G  0 part
└─sda5      8:5    0  12.1G  0 part [SWAP]
sr0        11:0    1  1024M  0 rom
gm4slv@laptop:~/piimg $ sudo mount /dev/loop0p2 /mnt
  • remove mounted image
gm4slv@laptop:~/piimg $ sudo umount /mnt
gm4slv@laptop:~/piimg $ sudo losetup -D

Git

Basic Workflow

  • do all changes to code
  • git add . to add changed files to staging
  • git commit -m “commit message” to do the commit
  • git push to push new commits to github

Windows Host File

  • Start → Windows Accessories → Notepad → <right click> … more…Run as Administrator
  • edit C:\Windows\System32\drivers\etc\hosts (set All files rather than txt to be able to see the hosts file in the file chooser)
  • Save

Auto SSH Tunnels

Used on remote installations to create persistent SSH reverse tunnels.

An example

Page Info

Page created Thu May 26 14:00:21 2022 by John Pumford-Green

Page last updated: 04/04/24 21:27 BST

public/computers/gists.txt · Last modified: 04/04/24 21:27 BST by john