Skip to main content

Posts

Solve Chrome doesn't allowed to install crx extension

The latest Chrome doesn't allowed user to install crx extension directly and request to install from Chrome web store, we can decompress the crx file to zip folder or download zip file for instead. Below Tunnel-Switch example will teach you how to pass it: Download Tunnel-Switch zip file:  https://github.com/oylbin/tunnel-switch Decompress zip file Chrome-->more tools-->extensions-->tick 'Developer mode'-->Load unpacked extension Browse to decompress zip folder to load Pass, click option to setup Remarks: For other extensions, when you load it, it'll prompt ''manifest_version'' should be 2 problem, you can refer below manifest.jason file to add red line to try. { " name " : " TunnelSwitch " , " version " : " 1.0.4 " , " manifest_version " : 2 , " description " : " cycle through your proxy settings " , " icons " : { " 128...

Upgrade BeautifulSoup4 to compatible with Python 3.6

After upgraded to Python 3.6 from 3.5, I encountered BeautifulSoup (bs4) error, such as 'ImportError: cannot import name 'HTMLParseError'. Seems there's compatible problem for BeautifulSoup 4 version. Solution: Upgrade beautifulsoup 4 version to 4.6.0 Commands: $ pip3 install --upgrade beautifulsoup4 Deep in: Install pip3 command: $ sudo apt install python3-pip

Simulate browser to solve https 403 error

As more and more website use https instead of http, we'll encounter 403 error when get content with requests modules. To solve it, the easiest way is simulating browser to access. OS: Debian 9 Python: 3.5.3 Module: requests setup headers as 1st step: headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3)\            AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36'} then add headers as parameter: res = requests.get(xqurl, headers=headers) Below is my example to get stock price in dictionary from a https website: getStockPriceFromXueqiu.py

Linux command to translate DomainName to IP

To translate Domain name to IP address, there are 2 commands in Linux: 1. dig +short [Domain name] eg: $ dig +short google.com 216.58.197.142 2. nslookup [Domain name] eg:$ nslookup google.com Server:         172.31.0.2 Address:        172.31.0.2#53 Non-authoritative answer: Name:   google.com Address: 172.217.26.14

speedometer: How to check Internet Speed via Terminal?

To check server current Internet speed, not the max speed in terminal/command line, the easiest way is speedometer. Take Ubuntu as example: Install: $ sudo apt install speedometer Usage: $ speedometer -rx eth0 unit conversion: bit=bit B=byte 1 byte=8 bit bps=bit/s MB/S = megabyte per second MiB/s = mebibyte per second 1 meibyte=2**20=1048576 bytes = 1024 kibibytes 1 Mbps=1 Mbit/s = 0.125MB/s =(0.125M/2**20)= 0.1192 MiB/s

Show Caps Lock indicator in Debian

For laptop who lacks of Caps Lock indicator, it's headache to check the button again and again. So, adapt a plugin should be a good idea. For Debian, I select indicator-keylock who was designed for Ubuntu although. You can find details here . Download .deb file on the right side. Right click to install with GDebi Package Installer, then logout to active it as following: Indicator for Lock Keys: An appindicator for showing the status of the keyboard lock keys, including Caps Lock, Num Lock and Scroll Lock. 

Setup Python Environment in Atom

If Atom is your preference text editor and Python 3 is one of your programming language, the blog is for you. It'll show you how to setup Python environment in Atom: edit and run. OS                 : Debian 9 Python          : 3.5 Atom version: 1.16.0 Atom Plugin :  atom-runner & autosave the 1st step is Atom installation, I think it should be done on your PC, otherwise, download .deb file from Atom website  and install it in terminal as following: sudo dpkg -i atom-amd64.deb If problem, fix it with: sudo apt-get install -f  The 2nd step is adjust configuration. Open Atom, select 'Edit'-->'Preferences'-->'Editor': Tick 'Show Indent Guide' Change 'Tab Length' to '4' The 3nd one is adding ' atom-runner ' and 'autosave' plugin. Click 'Packages' under 'Preferences' in above step, then search and install 'atom-runner' and 'autosave'. For 'autosave', clic...