957Htaccess and White-listing IPs

AuthUserFile /path/to/.htpasswd
AuthName "Restricted Access"
AuthType Basic
Require valid-user
Satisfy Any
Deny from All
Allow from 123.456.78.90

Allow IP ranges:

Allow from 123.456.78
Allow from 123.456

951Making a Bootable USB Stick – for Linux – in OSX

The Manjaro Wiki suggests to make a bootable USB Stick like that:

sudo dd bs=4M if=/path/to/manjaro.iso of=/dev/sd[drive letter] status=progress oflag=sync

While this might work on Linux, it does not work with dd on OSX/Darwin. Here are the error messages:

dd: bs: illegal numeric value
bs does not understand M
multiply manually, 4M -> 4 1024 1024 -> 4194304

sudo dd bs=4194304 if=/path/to.iso of=/dev/diskNr status=progress oflag=sync

dd: unknown operand status
dd on OSX does not understand the status flag
remove status flag

sudo dd bs=4194304 if=/path/to.iso of=/dev/diskNr oflag=sync

dd: unknown operand oflag
dd on OSX does not understand the oflag oflag
remove oflag flag

sudo dd bs=4194304 if=/path/to.iso of=/dev/diskNr

dd: /dev/disk4: Resource busy
Unmount disk before use, either via umount or in Disk Utility

And here we have it:

sudo dd bs=4194304 if=/path/to.iso of=/dev/diskNr

950SSH, Keys and Cyberduck

Environment: OSX 10.15.2

Understanding ~/.ssh/config

Host test.trembl.org              # Hostname
  User trembl                     # Username
  IdentityFile ~/.ssh/trembl_rsa  # Path to Key

Before config entry:

ssh -i ~/.ssh/trembl_rsa trembl@test.trembl.org

After config entry:

ssh trembl@test.trembl.org

.ssh/config looks up the corresponding IdentityFile and applies the matching IdentityFile for user & host

Keychain Access, SSH & Cyberduck

Adding key to the ssh agent:

ssh-add -K ~/.ssh/trembl_rsa

Check, if the key is present?

ssh-add -l 

Response:

2048 SHA256:abcdefghijk trembl@Fischer.local (RSA)

This does not add the key to the Keychain Access App. Does it survive a restart, or will it only be in RAM?

Answer?

Login in via Cyberduck adds Passphrase to the Keychain Access App. Is this persistent?

948Adding a CSS Framework to Vue

In your Vue Project, add your favourite CSS Framework vis npm.

npm install tachyons --save-dev

In main.js add:

import 'tachyons/css/tachyons.min.css' 
// no need for ./../node_modules/ prefix

Adding a Static CSS File

Add style.css to /public/:

In /public/index.html reference the Style Sheet:

<link rel="stylesheet" type="text/css" href="style.css">

946Pulling a GitLab Repository with Tokens & Webhooks

Update from 864 Pulling a GitHub Repository with Tokens & Webhooks

GitLab requries a gitlab-ci-token: prefix:

$token = 'gitlab-ci-token:abcdefghijklmopq'

944Overwrite local changes with git pull

git pull does not overwrite any local changed files by default. If you want to overwrite - and loose - any local changes, use:

git reset --hard origin/main

origin/main might be origin/master for legacy repos.

941Local SSH Key via ssh-add

  • Add SSH to the Git Service
  • Run ssh-add locally
  • Connect via ssh to your server
ssh-add
ssh user@host

git status
git ...

Check status of ssh-add

ssh-add -l

Delete all keys from current process

ssh-add -D

940Protecting a Single File with .htaccess

In .htaccess:

<Files myfile.php>
AuthType Basic
AuthName "Authentication Required"
AuthUserFile /path/to/.htpasswd
Require valid-user
</Files>

939Browsers Windows with less than 500px

As of 2019, the minimum window width for both Chrome and Safari browser windows is 500px. Which is might annoying, if your are developing a site with breakpoint at less than 500px.

window.open(
  'https://codec.trembl.org/939',
  'myDevWindow',   
  'width=400,height=400,resizable,scrollbars=yes,status=yes'
)



Example:



Observations:

In Chrome, the window becomes fully resizable, up to a 188 x 113px - which seems to be the absolute minimal window size.

In Safari, the window becomes resizable up to the specified size, the minimum size being 100px wide and 77px high.

937Creating entries for htpasswd

htpasswd -nb username password

Using just -n username will prompt twice for the password.

htpasswd -n username

From htpasswd man:

-n Don't update file; display results on stdout.
-b Use the password from the command line rather than prompting for it.