Posts on techy stuff
Subscribe with RSS to keep up with the latest news.
Grep - Powershell style
January 09, 2022grep
Use this powershell command to find text in files, grep style:
gci -r | sls 'some text'
or
Get-ChildItem -Recurse | Select-String 'some text'
Fix apt upgrade error when connecting to fr.archive.ubuntu.com
December 03, 2021apt-get
Recently, when trying to upgrade my tiny Ubuntu Server, got this error:
Failed to fetch http://fr.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease Cannot initiate the connection to fr.archive.ubuntu.com:80 (2001:bc8:1600:4:63f:72ff:feaf:a2de). - connect (101: Network is unreachable)
I thought that the issue was related to IPv6, so I disabled it:
nano /etc/sysctl.conf1
Add:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Run sysctl -p
Confirm cat /proc/sys/net/ipv6/conf/all/disable_ipv6
It should return 1 (disabled)
This didn’t help (also got error with IPv4)
W: Failed to fetch http://fr.archive.ubuntu.com/ubuntu/dists/focal/InRelease Could not connect to fr.archive.ubuntu.com:80 (51.158.154.169), connection timed out
So, after doing a ping to fr.archive.ubuntu.com
and confirming it’s down, just replaced it with us.archive.ubuntu.com
:
nano /etc/apt/sources.list
Finally packages upgrade is running
apt-get update
apt upgrade
Installing qBitTorrent on Ubuntu Server
July 02, 2021qBitTorrent
qBittorrent-nox includes only the Web UI http://localhost:8080
Installation instructions
sudo:
add-apt-repository ppa:qbittorrent-team/qbittorrent-stable
apt install qbittorrent-nox
adduser --system --group qbittorrent-nox
sudo adduser your-username qbittorrent-nox
sudo nano /etc/systemd/system/qbittorrent-nox.service
[Unit]
Description=qBittorrent Command Line Client
After=network.target
[Service]
#Do not change to "simple"
Type=forking
User=qbittorrent-nox
Group=qbittorrent-nox
UMask=007
ExecStart=/usr/bin/qbittorrent-nox -d --webui-port=8080
Restart=on-failure
[Install]
WantedBy=multi-user.target
Service operations
sudo systemctl start qbittorrent-nox
sudo systemctl daemon-reload
sudo systemctl enable qbittorrent-nox
systemctl status qbittorrent-nox
Accessing it after install
192.168.0.102:8080
- Username is
admin
. Default password isadminadmin
.
A few things missing
- You need to install the search plugins that matched your needs and are legal in your country Open the Search Tab, and click on Search Plugins
- If you customized the Downloads folder, it does not persist when saved from the UI
Open the config file
/home/qbittorrent-nox/.config/qBittorrent/qBittorrent.conf
and save it the [Preferences] section ` Downloads\SavePath=/media/torrents/ ` - Restart the service for the changes to take place
systemctl restart qbittorrent-nox
Reference
Overall instructions for installing qBitTorrent on Ubuntu Server can be followed from this [link] (https://www.linuxbabe.com/ubuntu/install-qbittorrent-ubuntu-18-04-desktop-server)
How this site was created
March 12, 2021jekyllssg
Publishing a site using an SSG from GitHub Actions
After using Wordpress
for several years (on-off), I decided to move to SSG (Static Site Generator)
I come to love markdown
, and the ability to write my posts from VS Code
directly.
So, here I will just give a high level overwiew of what takes to create a simple site using SSG.
read moreHow To Extract a Certificate From a HTTPS Call
March 08, 2021httpscertificate
Export a Server Certificate Using .NET Core
Sometimes you want to programmatically extract / export the server certificates in a HTTPS call.
Well, it’s pretty simple. See below a C# working example for .NET Core
Home Server with Ubuntu and a Streaming Device
February 15, 2021Installing Ubuntu and Tranmission in a Minix Neo Z64-W
Got a Minix Neo Z64-W from a friend, it comes with Windows, and runs pretty sluggish My old XtreamerTV device managed to burn two internal 2.5” hard drives (this is another story) So, project at hand:
- Install Ubuntu Server on the Minix Neo Z64-W
- Configure a few critical services:
- SSH
- Samba (to access content in the local network, upnp is better, but VLC cannot get subtitles using upnp)
- duf (just because)
- Mount external USB disk, and make sure it’s mounted after restart
- Install Transmission
Powershell: Delete all local branches except master
December 10, 2020use carefully
Assuming your local git repo is on master, you can delete all local branches except master using this one-line powershell script:
git branch | foreach { $_.split( "`n" ) } | foreach { if ($_ -ne '* master' ) { git branch -D $_.replace(' ', '') } }
Debugging Javascript scripts in VS Code
August 24, 2020To debug Javascript code in VS Code you will need:
- VS Code, and two extensions: Live Server, Chrome Debugger.
- Download the JS file for the corresponding site
https://<source?/script.js?
- Change JS reference to the local file
<script src="../scripts/script.js
- Format JS file (use some online beautifier, e.g https://beautifier.io/)
- Set your launch.json file
{ "version": "0.2.0", "configurations": [ { "name": "Launch localhost", "type": "chrome", "request": "launch", "url": "http://localhost:5500/index.html", "webRoot": "${workspaceFolder}/", "runtimeExecutable": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" } ] }
- Set break point
- Start debugging (F5)
How To Create a Docker Image during GitLab Pipeline
August 20, 2020k8s
Use:
- image
docker:dind
- selector:
tags: - kubernetes
- docker daemon detached
dockerd &
Example:
create_docker_image:
image: docker:dind
stage: build
script:
- dockerd &
- sleep 5
- docker build -t <registry>/docs:1.0.0 --no-cache .
only:
- master
tags:
- kubernetes
Apple and OIDC Login
August 11, 2020oidcapple
Lessons learned when configuring Apple for OIDC Login
read moreWant to see more? See the Posts Archive.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.