The following sites publish icons without attribution:
Allgemein
What is the IPv6 address [2803:f800:50::6ca2:c2f1]?
2803:f800:50::6ca2:c2f1
is the Cloudflare DNS server raina.ns.cloudflare.com
.
How to download Wasabi/S3 object to file using boto3 in Python
You can use boto3’s download_fileobj()
in order to download files from S3 to the local filesystem:
with open("myfile.txt", "wb") as outfile: my_bucket.download_fileobj("myfile.txt", outfile)
Note that the file needs to be opened in binary mode ("wb"
).
Full example
import boto3 # Create connection to Wasabi / S3 s3 = boto3.resource('s3', endpoint_url = 'https://s3.eu-central-1.wasabisys.com', aws_access_key_id = 'MY_ACCESS_KEY', aws_secret_access_key = 'MY_SECRET_KEY' ) # Get bucket object my_bucket = s3.Bucket('boto-test') # Download remote object "myfile.txt" to local file "test.txt" my_bucket.download_file("myfile.txt", "test.txt")
Don’t forget to fill in MY_ACCESS_KEY
and MY_SECRET_KEY
. Depending on what region and what S3-compatible service you use, you might need to use another endpoint URL instead of https://s3.eu-central-1.wasabisys.com
.
How to fix ‘need fortran-95+TR-15581/fortran-2003 compiler, not f77. Stop.’
Problem:
While trying to compile a software, you see this error message:
makefile:252: *** need fortran-95+TR-15581/fortran-2003 compiler, not f77. Stop.
Solution:
Run
export FC=gfortran
then retry the command that caused the error (e.g. make
)
How to fix htpasswd cannot open file htpasswd for read/write access
Problem:
You are trying to add/change a password in a htpasswd
file using a command like
htpasswd auth.htpasswd myuser
but you see this error message:
htpasswd: cannot open file htpasswd for read/write access
Solution:
htpasswd
is trying to tell you that it got Permission denied
when accessing the htpasswd file and hence can’t read it or it can’t write the file (auth.htpasswd
in this example).
There are multiple ways to fix this:
- Run
htpasswd
usingsudo
, e.g.sudo htpasswd auth.htpasswd myuser
- Fix the permissions of the file, e.g. using
sudo chown $USER auth.htpasswd chmod o+rw auth.htpasswd
Note that this permanently modifies the permissions for the
htpasswd
file and hence might create additional security risks! - Use a different
htpasswd
file to which you have access. You need to change the configuration on your webserver etc (i.e. the software that is using thehtpasswd
file). This option isn’t always available – e.g. if you can’t change the webserver’s configuration, you just have the option of asking the system administrator nicely.
How to reset Yealink T46G to factory settings
In order to reset your Yealink T46G to factory settings:
- Turn on the phone and wait until it has booted up
- Press the OK button until the phone asks you if you want to reset to factory settings
- Confirm the factory reset by pressing OK (i.e. the button on the bottom right of the screen, i.e. the rightmost button of the row of buttons just below the screen)
- Wait for the phone to reset
Random port number generator
This port generator generates a random TCP/UDP port between 1024 and 65535
Your personal random port: Port
Click here to generate a new random port number
How to install RabbitMQ on Ubuntu in 30 seconds
Use our script:
wget -qO- https://techoverflow.net/scripts/install-rabbitmq.sh | sudo bash /dev/stdin
This will install RabbitMQ and its dependencies from the official deb repositories.
Or do it manually:
Copy and paste these command blocks into your Linux shell. You need to copy & paste one block at a time – you can paste the next block once the previous block is finished!
sudo apt-get update -y sudo apt-get install apt-transport-https curl gnupg -y curl -fsSL https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc | sudo apt-key add -
sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF deb https://dl.bintray.com/rabbitmq-erlang/debian $(lsb_release -cs) erlang deb https://dl.bintray.com/rabbitmq/debian $(lsb_release -cs) main EOF
sudo apt-get update -y sudo apt-get install rabbitmq-server -y --fix-missing
How to cleanup large gitlab prometheus/data in Omnibus/Docker setting
In many of my dockerized Gitlab instances, the prometheus/data
folder was eating up multiple Gigabytes of hard drive space even though I was not using Prometheus at all.
In order to fix this, I first disabled Prometheus in the docker-compose.yml
config using
prometheus_monitoring['enable'] = false
Also see How I reduced gitlab memory consumption in my docker-based setup for a detailed explanantion.
After that, you need to restart gitlab in order for the settings change to take effect.
Now you can just delete the Prometheus data folder. Make a backup of the entire gitlab data folder before this step.
Run this command from within your gitlab data folder:
rm -rf prometheus/data
Cylinder volume calculator (from diameter & height)
Calculate the volume of a cylinder from its diameter and height using this online calculator – formula included.
You can enter values with SI suffixes like 12.2m (equivalent to 0.012) or 14k (14000) or 32u (0.000032).
The results are calculated while you type and shown directly below the calculator, so there is no need to press return or click on a Calculate button. Just make sure that all inputs are green by entering valid values.
V = \pi\cdot(\frac{d}{2})²\cdot h
Bilirubin mg/dl to μmol/l converter
Convert Bilirubin from mg/dl to μmol/l using this online calculator – formula included.
This information is presented for informational purposes only and is intended for professionals. While we strive to provide accurate information, this information might be outdated, unintentionally misleading or incorrect. Consult a medical professional and/or read the primary sources cited in our article before basing any decision on this information.
You can enter values with SI suffixes like 12.2m (equivalent to 0.012) or 14k (14000) or 32u (0.000032).
The results are calculated while you type and shown directly below the calculator, so there is no need to press return or click on a Calculate button. Just make sure that all inputs are green by entering valid values.
Accessory cord tensile strength calculator (EN 564)
Calculate the tensile strength of accessory cords according to EN564 using this online calculator – formula included.
You can enter values with SI suffixes like 12.2m (equivalent to 0.012) or 14k (14000) or 32u (0.000032).
The results are calculated while you type and shown directly below the calculator, so there is no need to press return or click on a Calculate button. Just make sure that all inputs are green by entering valid values.
Sense resistor / current shunt + current sense amplifier calculator
Calculate the output voltage of a current sense amplifier combined with a current shunt resistor – formula included.
You can enter values with SI suffixes like 12.2m (equivalent to 0.012) or 14k (14000) or 32u (0.000032).
The results are calculated while you type and shown directly below the calculator, so there is no need to press return or click on a Calculate button. Just make sure that all inputs are green by entering valid values.
Don’t need a current sense amplifier? See our Sense resistor / current shunt calculator.
This calculator allows you to find out which sense resistor and current sense amplifier you need to use to obtain a specific amplifier output voltage at a specific current.
Sense resistor / current shunt calculator
You can enter values with SI suffixes like 12.2m (equivalent to 0.012) or 14k (14000) or 32u (0.000032).
The results are calculated while you type and shown directly below the calculator, so there is no need to press return or click on a Calculate button. Just make sure that all inputs are green by entering valid values.
Too much power dissipation? You need to use a current sense amplifier ! See our Sense resistor / current shunt + current sense amplifier calculator !
Know the value of your sense resistor already? Use our Sense resistor power dissipation calculator
This calculator allows you to find out which sense resistor you need to drop a specified voltage at a given current. Additionally it computes the power dissipated in the sense resistor.
Relay lifetime online calculator
You can enter values with SI suffixes like 12.2m (equivalent to 0.012) or 14k (14000) or 32u (0.000032).
The results are calculated while you type and shown directly below the calculator, so there is no need to press return or click on a Calculate button. Just make sure that all inputs are green by entering valid values.
Note: A cycle is typically defined as switching the relay on and switching it off again, i.e. one cycle consists of two switch actions (on + off).
In case you know how many seconds between cycles:
In case you know how many relay cycles per second:
Go HTTP Server minimal example
package main import ( "fmt" "log" "net/http" ) func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello world!") }) // log.Fatal shows you if there is an error like the // port already being used log.Fatal(http.ListenAndServe(":8080", nil)) }
Save this file as Main.go
in a directory called GoHTTPServer
, run go build && ./GoHTTPServer
. Then, open http://localhost:8080 in your browser and see the result for yourself.
Go HTTP client minimal example
This example gets the current IPv4 address from TechOverflow’s IP address HTTP API How to get your current IPv4 address using wget.
package main import ( "io/ioutil" "net/http" ) func main() { // Perform request resp, err := http.Get("https://ipv4.techoverflow.net/api/get-my-ip") if err != nil { print(err) return } // Cleanup when this function ends defer resp.Body.Close() // Read all the response data into a []byte body, err := ioutil.ReadAll(resp.Body) // Decode & print println(string(body)) }
Save as Main.go
in a new project directory (e.g. GoHttpTest
) and run go build
in that directory.
After that, you can run ./GoHttpTest which should print your IPv4 adress. Example:
[email protected] ~/GoHttpTest % go build [email protected] ~/GoHttpTest % ./GoHttpTest 91.59.80.56
How to fix Angular Cannot find module ‘@angular/http’ after ‘ng update’
When updating to Angular 8.x+, developers commonly encouter this type of error:
app/app.module.ts:9:42 - error TS2307: Cannot find module '@angular/http'. 9 import {HttpModule, RequestOptions} from '@angular/http';
The solution
The @angular/http
module has been removed in recent versions of Angular and replaced by @angular/common/http
. Furthermore, there are some name changes that might need manual fixing, including:
HttpModule
⇒HttpClientModule
Http
⇒HttpClient
URLSearchParams
⇒HttpParams
Note that the replacements are not always exact equivalent and hence might require some work to get working
See the official @angular/http deprecation guide for more details on how to migrate.
How to fix vpnc-disconnect ‘no vpnc found running’
Problem:
You want to disconnect from your vpnc
VPN using vpnc-disconnect
, but you see this error message:
Solution:
vpnc-disconnect doesn’t know the difference between no vpnc is running and permission denied when trying to stop the vpnc daemon.
In most cases, using sudo
:
sudo vpnc-disconnect
will fix the issue.
If this does not resolve the issue for you, check if you used the --pid-file
argument to vpnc
. vpnc-disconnect
always assumes that the PID file is /var/run/vpnc.pid
.
Alternatively, check out our alternate methods of stopping vpnc
.
What is the pullup/pulldown resistor value on the SAMD21?
Also see Does the SAMD21 have pullups on every pin?
The ATSAMD21 microcontrollers have integrated pull-up and pull-down resistors which you can enable or disable in software.
The nominal value of the pull-up and pull-down resistors is 40 kΩ but it can be between 20 kΩ and 60 kΩ.
Refer to the datasheet, section 37.9.1 for more details.