From 0b9acaf9eb8ba65595fe2762abfa79b0cd636acf Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Fri, 21 May 2021 18:59:15 +0100 Subject: Add defer attribute to js links --- www/index.html | 4 ++-- .../2020-05-25/installing-arch-linux-on-a-thinkpad-x220/index.html | 4 ++-- www/posts/arch/2020-06-15/adding-a-user-in-arch-linux/index.html | 4 ++-- .../granting-sudo-access-to-a-user-in-arch-linux/index.html | 4 ++-- .../arch/2020-08-17/installing-st-dmenu-dwm-in-arch-linux/index.html | 4 ++-- .../arch/2020-08-24/pacman-cheat-sheet-for-ubuntu-users/index.html | 4 ++-- www/posts/arch/2020-08-31/enabling-audio-in-arch-linux/index.html | 4 ++-- .../installing-zsh-and-powerlevel10k-on-arch-linux/index.html | 4 ++-- www/posts/arch/index.html | 4 ++-- .../how-to-host-your-own-gemini-site-in-the-cloud/index.html | 4 ++-- www/posts/gemini/index.html | 4 ++-- www/posts/index.html | 4 ++-- www/posts/jigsaw/2020-06-01/scheduling-posts-in-jigsaw/index.html | 4 ++-- www/posts/jigsaw/index.html | 4 ++-- .../index.html | 4 ++-- .../2020-12-21/installing-laravel-homestead-in-arch-linux/index.html | 4 ++-- www/posts/laravel/index.html | 4 ++-- .../2020-07-13/sudo-sorry-you-must-have-a-tty-to-run-sudo/index.html | 4 ++-- www/posts/linux/index.html | 4 ++-- .../markdown/2020-03-30/creating-an-ebook-with-markdown/index.html | 4 ++-- www/posts/markdown/index.html | 4 ++-- .../publishing-jigsaw-posts-with-netlify-build-hooks/index.html | 4 ++-- www/posts/netlify/index.html | 4 ++-- .../2021-02-15/accessing-nextcloud-with-webdav-on-arch/index.html | 4 ++-- www/posts/nextcloud/index.html | 4 ++-- www/posts/php/2021-01-18/installing-php-8-for-windows-10/index.html | 4 ++-- www/posts/php/index.html | 4 ++-- 27 files changed, 54 insertions(+), 54 deletions(-) (limited to 'www') diff --git a/www/index.html b/www/index.html index 51c693e..9c405fa 100644 --- a/www/index.html +++ b/www/index.html @@ -22,7 +22,7 @@

The Home of David T. Sadler

Hello and welcome to my little bit of the internet where I occasionally write about things that interest me. You might find my posts interesting or you might not and that's okay.

Latest Posts

2021-02-15 - Accessing Nextcloud With WebDAV on Arch2021-02-08 - How to Host Your Own Gemini Site in the Cloud2021-01-18 - Installing PHP 8 for Windows 102020-12-21 - Installing Laravel Homestead in Arch Linux2020-12-14 - SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed2020-09-07 - Installing Zsh and Powerlevel10k on Arch Linux2020-08-31 - Enabling Audio in Arch Linux2020-08-24 - Pacman Cheat Sheet For Ubuntu Users2020-08-17 - Installing ST, DMENU and DWM in Arch Linux2020-07-13 - Sudo: sorry, you must have a tty to run sudo2020-06-22 - Granting Sudo Access to a User in Arch Linux2020-06-15 - Adding a User in Arch Linux2020-06-08 - Publishing Jigsaw Posts With Netlify Build Hooks2020-06-01 - Scheduling Posts in Jigsaw2020-05-25 - Installing Arch Linux on a Thinkpad X2202020-03-30 - Creating an Ebook With Markdown

All Posts

Post Archive

Tags

ArchGeminiJigsawLaravelLinuxMarkdownNetlifyNextcloudPHP

Where to Find Me

GitHubGemini SiteEmail david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

- - + + diff --git a/www/posts/arch/2020-05-25/installing-arch-linux-on-a-thinkpad-x220/index.html b/www/posts/arch/2020-05-25/installing-arch-linux-on-a-thinkpad-x220/index.html index 99104bd..bb54297 100644 --- a/www/posts/arch/2020-05-25/installing-arch-linux-on-a-thinkpad-x220/index.html +++ b/www/posts/arch/2020-05-25/installing-arch-linux-on-a-thinkpad-x220/index.html @@ -118,7 +118,7 @@ efibootmgr \ --loader /vmlinuz-linux \ --unicode 'cryptdevice=PARTUUID='$PARTUUID':cryptlvm root=/dev/vg0/root rw initrd=\intel-ucode.img initrd=\initramfs-linux.img' \ --verbose 

The --unicode argument is where the kernel parameters are specified. This tells the system that the partition identified by PARTUUID is encrypted and that the root filesystem to mount is the logical volume called root that is part of the volume group vg0. The microcode is also loaded with initrd=\intel-ucode.img.

Make this script executable.

chmod u+x /usr/local/sbin/mkefibootentry

Run the script to add to the motherboard boot entries.

$ mkefibootentry

Root Password

Create a secure password for the root user.

$ passwd

Reboot

Return to the Arch live installation environment.

$ exit

Unmount the partitions.

$ umount -R /mnt

Restart the machine with reboot. Remember to remove any installation media such as a USB drive.

$ reboot

Provided nothing has gone wrong your machine will boot into a fresh installation of Arch Linux. Don't forget that during the boot you will be prompted to enter the passphrase to decrypt the system partition.

Following this guide will leave you with a very minimal system where you can login as the root user. From this point how you configure the system is up to you as it will be very different to how I configure my own. If you interested in seeing how I do it then see my other posts on the subject.

Links

Offical Arch Installation Guide.Arch Linux Download Page.Etcher.Pacman Mirrorlist Generator.Wikipedia Entry for Howl's Moving Castle.Arch - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. - - + + diff --git a/www/posts/arch/2020-06-15/adding-a-user-in-arch-linux/index.html b/www/posts/arch/2020-06-15/adding-a-user-in-arch-linux/index.html index cfee88e..36d196b 100644 --- a/www/posts/arch/2020-06-15/adding-a-user-in-arch-linux/index.html +++ b/www/posts/arch/2020-06-15/adding-a-user-in-arch-linux/index.html @@ -29,7 +29,7 @@ passwd: password updated successfully

Now all I have to do is log Password: david@suliman:$

Links

Installing Arch Linux on a Thinkpad X220.Arch - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. - - + + diff --git a/www/posts/arch/2020-06-22/granting-sudo-access-to-a-user-in-arch-linux/index.html b/www/posts/arch/2020-06-22/granting-sudo-access-to-a-user-in-arch-linux/index.html index a18f4ed..d170782 100644 --- a/www/posts/arch/2020-06-22/granting-sudo-access-to-a-user-in-arch-linux/index.html +++ b/www/posts/arch/2020-06-22/granting-sudo-access-to-a-user-in-arch-linux/index.html @@ -24,7 +24,7 @@

Granting Sudo Access to a User in Arch Linux

Mon 22nd 2020 By David T. Sadler.

So by the end of my last post my minimal installation of Arch Linux had a user account that I could log into instead of the root user. However in order to do anything useful on the system I need to be able to run commands such as pacman that only the root user can do. Now one way to solve this is to change to the root user with su before running the command, but this defeats the point in creating a non-root user account in the first place. Instead a better way is to make use of sudo.

Sudo (su "do") gives the ability for a user (or groups of users) to run some (or all) commands as root and also provides an audit trail of the commands and their arguments. Usage is very simple, you enter sudo followed by the command that you want to run. For example,

$ sudo pacman -Syu

Configuration is done in the file /etc/sudoers. This is where you can specify which users or groups can use sudo and what commands they can run. However, you must be careful when editing this file as any syntax errors will make sudo unusable. Therefore it is strongly recommended to do any editing via the visudo command. This locks the sudoers file, saves edits to a temporary file, and checks that file's grammar before copying it to /etc/sudoers.

Traditionally in Linux systems users that should have privileged administrator rights are added to the wheel group which is then given sudo access. As the root user the first thing that I needed to do was add my user account to the wheel group with the usermod command.

$ usermod -aG wheel david

I used the below options with the command.

The sudo package then needed to be installed.

$ pacman -S sudo

Next I needed to grant sudo access to the wheel group by editing /etc/sudoers with visudo. Note that the default editor for visudo is vi. Since this has not been installed on my system I can change the editor to be nvim by first setting the variable EDITOR.

$ EDITOR=nvim visudo

Once the file was opened I located and uncommented the below line before saving and exiting nvim. This allows members of the wheel group to execute any command without having to enter their password.

%wheel ALL(ALL) NOPASSWD: ALL

I checked that I had sudo access by running the below command while logged into my user account.

$ sudo pwd
 
 /home/david

Since I wasn't prompted for my password and the command was executed I knew that I now had sudo access.

Links

Adding a User in Arch Linux.Arch - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + diff --git a/www/posts/arch/2020-08-17/installing-st-dmenu-dwm-in-arch-linux/index.html b/www/posts/arch/2020-08-17/installing-st-dmenu-dwm-in-arch-linux/index.html index 8c86987..4e314ec 100644 --- a/www/posts/arch/2020-08-17/installing-st-dmenu-dwm-in-arch-linux/index.html +++ b/www/posts/arch/2020-08-17/installing-st-dmenu-dwm-in-arch-linux/index.html @@ -31,7 +31,7 @@ $ sudo make install

Configure and Install DMENU

Again mov $ sudo make install

Configure and Install DWM

For the final time move to the directory created earlier.

$ cd ~/.local/src/dwm

As with dmenu the same edit needs to be made to the file config.mk.

$ nvim config.mk
# XINERAMALIBS  = -lXinerama
 # XINERAMAFLAGS = -DXINERAMA

Compile and install as usual.

$ make clean
 $ sudo make install

Starting DWM

Since I have installed xorg-xinit I need to create a .xinitrc in my home folder.

$ nvim ~/.xinitrc

The contents of this file is just.

exec dwm

I can now start xorg and dwm with the below command.

$ startx

Links

Installing Arch Linux on a Thinkpad X220.Dynamic Window Manager (DWM).Suckless Software.Simple Terminal.DMenu.Arch - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. - - + + diff --git a/www/posts/arch/2020-08-24/pacman-cheat-sheet-for-ubuntu-users/index.html b/www/posts/arch/2020-08-24/pacman-cheat-sheet-for-ubuntu-users/index.html index e34f122..16e9389 100644 --- a/www/posts/arch/2020-08-24/pacman-cheat-sheet-for-ubuntu-users/index.html +++ b/www/posts/arch/2020-08-24/pacman-cheat-sheet-for-ubuntu-users/index.html @@ -44,7 +44,7 @@ $ pacman -Syu

Since Arch uses a rolling release system there is n $ pacman -Scc

Free up disk space by removing from the cache any packages that are no longer installed. Also removes any cached sync databases.

Remove Used Dependencies

$ pacman --query --deps --unrequired --quiet | pacman --remove --recursive -
 
 $ pacman -Qdtq | pacman -Rs -

Remove dependencies that are no longer needed, because e.g. the package which needed the dependencies was removed.

Links

Installing Arch Linux on a Thinkpad X220.Arch - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. - - + + diff --git a/www/posts/arch/2020-08-31/enabling-audio-in-arch-linux/index.html b/www/posts/arch/2020-08-31/enabling-audio-in-arch-linux/index.html index 601959b..63b9b0d 100644 --- a/www/posts/arch/2020-08-31/enabling-audio-in-arch-linux/index.html +++ b/www/posts/arch/2020-08-31/enabling-audio-in-arch-linux/index.html @@ -26,7 +26,7 @@ $ amixer sset Speaker unmute $ amixer sset Headphone unmute

You can test that the speakers are working with the speaker-test command.

$ speaker-test -c 2

If you are still getting no sound then it could be that the volume has been set to zero. Use amixer again to increase the volume.

$ amixer sset Master 100%
 $ amixer sset Speaker 100%
 $ amixer sset Headphone 100%

Unmute with Alsamixer

If you prefer a more intuitive ncurses interface you can use alsamixer.

$ alsamixer

Channels that are muted will have the MM label below them. Unmuted channels have 00.

Use the ← and → keys to scroll to the muted channel and press m to unmute it.

The volume can be increased and decreased with the ↑ and ↓ keys.

Links

Installing Arch Linux on a Thinkpad X220.Arch - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. - - + + diff --git a/www/posts/arch/2020-09-07/installing-zsh-and-powerlevel10k-on-arch-linux/index.html b/www/posts/arch/2020-09-07/installing-zsh-and-powerlevel10k-on-arch-linux/index.html index 0411eb1..14230da 100644 --- a/www/posts/arch/2020-09-07/installing-zsh-and-powerlevel10k-on-arch-linux/index.html +++ b/www/posts/arch/2020-09-07/installing-zsh-and-powerlevel10k-on-arch-linux/index.html @@ -33,7 +33,7 @@ $ zsh-newuser-install -f

Changing The Default Shell

Insta /usr/bin/zsh

The same command can be used to change the default shell by providing it with the full path to the shell.

$ chsh -s /bin/zsh

Note that this change is not instant and you will need to log out and log in again for it to take affect. Once you have done that check the SHELL environment variable again to confirm the change.

$ echo $SHELL
 
 /bin/ksh

Installing Powerlevel10k

Powerlevel10k is a theme for Zsh and in order to make the most of it you should install the Meslo Nerd Font that has been patched for Powerlevel10k.

$ yay -Sy --noconfirm ttf-meslo-nerd-font-powerlevel10k

You need to configure your terminal to use this font. How this is done is dependant upon what terminal you are using. Since I use st from suckless I need to edit the file config.h and specify MesloLGS NF in the font settings.

static char *font = "MesloLGS NF:pixelsize=14:antialias=true:autohint=true";

Before rebuilding st.

$ sudo make install

Now that the dependences have been meet Powerlevel10k can be installed.

$ yay -Sy --noconfirm zsh-theme-powerlevel10k-git

Once it has been installed ensure that Zsh loads Powerlevel10k.

$ echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc

You can now open a new terminal which will start the Powerlevel10k configuration wizard. This will ask you a few questions and configure your prompt. If it doesn't trigger automatically, type p10k configure.

Once the configuration wizard has finished open a new terminal and you should see the Powerlevel10k theme been used.

Links

Installing Arch Linux on a Thinkpad X220.Zsh.Powerlevel10k.Simple Terminal.Arch - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. - - + + diff --git a/www/posts/arch/index.html b/www/posts/arch/index.html index dccb40c..16dd9a8 100644 --- a/www/posts/arch/index.html +++ b/www/posts/arch/index.html @@ -22,7 +22,7 @@

The Home of David T. Sadler - All Posts About Arch

2020-09-07 - Installing Zsh and Powerlevel10k on Arch Linux2020-08-31 - Enabling Audio in Arch Linux2020-08-24 - Pacman Cheat Sheet For Ubuntu Users2020-08-17 - Installing ST, DMENU and DWM in Arch Linux2020-06-22 - Granting Sudo Access to a User in Arch Linux2020-06-15 - Adding a User in Arch Linux2020-05-25 - Installing Arch Linux on a Thinkpad X220

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + diff --git a/www/posts/gemini/2021-02-08/how-to-host-your-own-gemini-site-in-the-cloud/index.html b/www/posts/gemini/2021-02-08/how-to-host-your-own-gemini-site-in-the-cloud/index.html index b918199..efd8f03 100644 --- a/www/posts/gemini/2021-02-08/how-to-host-your-own-gemini-site-in-the-cloud/index.html +++ b/www/posts/gemini/2021-02-08/how-to-host-your-own-gemini-site-in-the-cloud/index.html @@ -79,7 +79,7 @@ WantedBy=default.target

I then started this service and confirmed it was $ sudo systemctl status agate.service Active: active (running)

The final step was to have this service start when the system is rebooted.

$ sudo systemctl enable agate.service

Conclusion

Setting up a Gemini site was easy to do and I hope this guide shows it. I have several ideas about how I'm going to use this new site and I'm excited to see where this leads to.

Links

Gandi.net - My domain registrar of choice.Hetzner - My cloud server provider.Agate - A simple Gemini server.davidtsadler.co.uk - My Gemini site.Gemini - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. - - + + diff --git a/www/posts/gemini/index.html b/www/posts/gemini/index.html index ccf86af..bd18574 100644 --- a/www/posts/gemini/index.html +++ b/www/posts/gemini/index.html @@ -22,7 +22,7 @@

The Home of David T. Sadler - All Posts About Gemini

2021-02-08 - How to Host Your Own Gemini Site in the Cloud

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + diff --git a/www/posts/index.html b/www/posts/index.html index 95f37a1..3af045f 100644 --- a/www/posts/index.html +++ b/www/posts/index.html @@ -22,7 +22,7 @@

The Home of David T. Sadler - All Posts

2021-02-15 - Accessing Nextcloud With WebDAV on Arch2021-02-08 - How to Host Your Own Gemini Site in the Cloud2021-01-18 - Installing PHP 8 for Windows 102020-12-21 - Installing Laravel Homestead in Arch Linux2020-12-14 - SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed2020-09-07 - Installing Zsh and Powerlevel10k on Arch Linux2020-08-31 - Enabling Audio in Arch Linux2020-08-24 - Pacman Cheat Sheet For Ubuntu Users2020-08-17 - Installing ST, DMENU and DWM in Arch Linux2020-07-13 - Sudo: sorry, you must have a tty to run sudo2020-06-22 - Granting Sudo Access to a User in Arch Linux2020-06-15 - Adding a User in Arch Linux2020-06-08 - Publishing Jigsaw Posts With Netlify Build Hooks2020-06-01 - Scheduling Posts in Jigsaw2020-05-25 - Installing Arch Linux on a Thinkpad X2202020-03-30 - Creating an Ebook With Markdown

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + diff --git a/www/posts/jigsaw/2020-06-01/scheduling-posts-in-jigsaw/index.html b/www/posts/jigsaw/2020-06-01/scheduling-posts-in-jigsaw/index.html index 9438359..292ee9f 100644 --- a/www/posts/jigsaw/2020-06-01/scheduling-posts-in-jigsaw/index.html +++ b/www/posts/jigsaw/2020-06-01/scheduling-posts-in-jigsaw/index.html @@ -36,7 +36,7 @@ return [ ], ], ];

When deploying the site each post is passed to this filter. The first thing it does is convert the date that has been specified in the post's YAML front matter into a Carbon instance. It then returns true if the date is on or before the current date, I.e. when the site is been deployed.

With this filter I can specify future dates for several posts and they will only published once that date comes around. Posts are also exluded if a date has not been specified. This allows me to have posts that are a work in progress and shouldn't be published.

Links

Jigsaw - Static Site Generator for PHP Developers.Using Filters in Jigsaw.Carbon - PHP API Extension for DateTime.Jigsaw - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. - - + + diff --git a/www/posts/jigsaw/index.html b/www/posts/jigsaw/index.html index 9d2b42f..e4132c0 100644 --- a/www/posts/jigsaw/index.html +++ b/www/posts/jigsaw/index.html @@ -22,7 +22,7 @@

The Home of David T. Sadler - All Posts About Jigsaw

2020-06-01 - Scheduling Posts in Jigsaw

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + diff --git a/www/posts/laravel/2020-12-14/sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/index.html b/www/posts/laravel/2020-12-14/sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/index.html index 88ed736..2396d42 100644 --- a/www/posts/laravel/2020-12-14/sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/index.html +++ b/www/posts/laravel/2020-12-14/sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/index.html @@ -41,7 +41,7 @@ Illuminate\Database\QueryException +33 vendor frames 34 artisan:37 Illuminate\Foundation\Console\Kernel::handle()

The cause of this issue is due to a change introduced to the .env.example file. This changed the environment variable DB_HOST from 127.0.0.1 to mysql. The reason for this change is to support [Laravel Sail](https://laravel.com/docs/8.x/sail) which is a Docker development environment for Laravel.

The change means your Laravel application will try and connect to a database server with the hostname of mysql. Unless this exists then the application can't connect.

To resolve the issue just change the value back to 127.0.0.1

DB_HOST=127.0.0.1

Links

Commit that changed .env.example.Laravel SailLaravel - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. - - + + diff --git a/www/posts/laravel/2020-12-21/installing-laravel-homestead-in-arch-linux/index.html b/www/posts/laravel/2020-12-21/installing-laravel-homestead-in-arch-linux/index.html index 7bc316e..1aab406 100644 --- a/www/posts/laravel/2020-12-21/installing-laravel-homestead-in-arch-linux/index.html +++ b/www/posts/laravel/2020-12-21/installing-laravel-homestead-in-arch-linux/index.html @@ -74,7 +74,7 @@ DB_USERNAME=testsite DB_PASSWORD=testsite

Now when you browse to http://testsite.local you will see the Laravel welcome page.

Simplified SSH

I prefer to just use the host system's ssh command to connect to Homestead as it cuts out having to navigate to the Homestead directory and running vagrant ssh.

To simplify ssh I first add a hostname for the virtual machine to the file /etc/hosts/

192.168.10.10 homestead

I then edit ~/.ssh/config and add the below configuration. This tells ssh to automatically use the keys and username specified when connecting to the virtual machine.

Host homestead
   IdentityFile ~/.ssh/homestead/id_rsa
   User vagrant

From now on I can simply do ssh homestead from any directory to connect to the Homestead virtual machine.

Links

Laravel HomesteadLaravel - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. - - + + diff --git a/www/posts/laravel/index.html b/www/posts/laravel/index.html index d410bf2..6a6d37d 100644 --- a/www/posts/laravel/index.html +++ b/www/posts/laravel/index.html @@ -22,7 +22,7 @@

The Home of David T. Sadler - All Posts About Laravel

2020-12-21 - Installing Laravel Homestead in Arch Linux2020-12-14 - SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + diff --git a/www/posts/linux/2020-07-13/sudo-sorry-you-must-have-a-tty-to-run-sudo/index.html b/www/posts/linux/2020-07-13/sudo-sorry-you-must-have-a-tty-to-run-sudo/index.html index a666034..e5f9c07 100644 --- a/www/posts/linux/2020-07-13/sudo-sorry-you-must-have-a-tty-to-run-sudo/index.html +++ b/www/posts/linux/2020-07-13/sudo-sorry-you-must-have-a-tty-to-run-sudo/index.html @@ -23,7 +23,7 @@

Sudo: sorry, you must have a tty to run sudo

Mon 13th July 2020 By David T. Sadler.

I have found Deployer to be a great tool for deploying PHP applications. However when first setting out to use it I soon came across the error message 'sudo: sorry, you must have a tty to run sudo'. After some investigation I found that the error was triggered when Deployer was running commands via sudo. For those that don't know Deployer works by executing commands on your servers via ssh and depending on your server's configuration there could be issues when sudo is one of those commands.

What is meant by 'sudo: sorry, you must have a tty to run sudo'?

When sudo is executed the file /etc/sudoers is read to determine which users or groups can use sudo and what commands they can run. It actually does a bit more than that and you should read the manual for more information.

If you examine the sudoers file you will find that it contains the setting Defaults requiretty. This means that sudo can only be ran from a real tty. In other words if a user wants to run sudo they must have logged into a terminal before hand. This is normally a security feature so that sudo can't be ran from things such as cron jobs. However, it also means that you will have issues when running sudo from another machine via ssh as you also won't be logged into an actual terminal.

How to resolve the issue?

If you're happy to change the setting for all users simply use visudo to edit /etc/sudoers and change Defaults requiretty to Defaults !requiretty. Alternatively you can remove the tty requirement for a single user. In fact that is what I do when using Deployer. Since it connects to the server using a user called deployer I add the below configuration with visudo.

Defaults:deployer !requiretty
 deployer ALL=(ALL) NOPASSWD:/usr/bin/chown, /usr/bin/tee, /usr/sbin/apachectl

This configuration allows the deployer user to execute sudo when not logged into a real terminal and additionally not prompt for a password when executing chown, tee, and apachectl.

Using Pseudo-tty

An alternative is to use the pseudo-tty option when connecting via ssh.

$ ssh -t user@example.com sudo apachectl restart

Links

Deployer - A Deployment Tool for PHP.Sudo Manual.Linux - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + diff --git a/www/posts/linux/index.html b/www/posts/linux/index.html index 9f62aed..7cd2f4c 100644 --- a/www/posts/linux/index.html +++ b/www/posts/linux/index.html @@ -22,7 +22,7 @@

The Home of David T. Sadler - All Posts About Linux

2020-07-13 - Sudo: sorry, you must have a tty to run sudo

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + diff --git a/www/posts/markdown/2020-03-30/creating-an-ebook-with-markdown/index.html b/www/posts/markdown/2020-03-30/creating-an-ebook-with-markdown/index.html index acbe24a..53f1fa2 100644 --- a/www/posts/markdown/2020-03-30/creating-an-ebook-with-markdown/index.html +++ b/www/posts/markdown/2020-03-30/creating-an-ebook-with-markdown/index.html @@ -58,7 +58,7 @@ This is the second paragraph of chapter 2. This is the first paragraph of chapter 3. This is the second paragraph of chapter 3.

Note that the file begins with a YAML metadata block that starts and ends with three hyphens (---). This allows you to specify EPUB metadata such as the title and author.

Converting this to EPUB is done by running pandoc.

$ pandoc example_ebook.md -t epub3 --toc -o example_ebook.epub

There are several options that need to be passed to pandoc.

You can now copy the file example_ebook.epub to any device that supports the format or use one of the many software readers such as Calibre. However, if you wish to read this on a Kindle device you will need to convert it to the Mobi format.

Amazon provides a command line tool called KindleGen that can convert our EPUB file into the Mobi format. After downloading the tool just run it as shown below.

$ kindlegen example_ebook.epub

This will create a file called example_ebook.mobi that you can copy to your Kindle to read.

Links

Pandoc.Markdown.EPUB.YAML metadata block.EPUB metadata.EPUB v3 book.Calibre Application.Mobi Format.KindleGen Application.Markdown - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. - - + + diff --git a/www/posts/markdown/index.html b/www/posts/markdown/index.html index 413df76..425ba73 100644 --- a/www/posts/markdown/index.html +++ b/www/posts/markdown/index.html @@ -22,7 +22,7 @@

The Home of David T. Sadler - All Posts About Markdown

2020-03-30 - Creating an Ebook With Markdown

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + diff --git a/www/posts/netlify/2020-06-08/publishing-jigsaw-posts-with-netlify-build-hooks/index.html b/www/posts/netlify/2020-06-08/publishing-jigsaw-posts-with-netlify-build-hooks/index.html index 903212d..aa3568e 100644 --- a/www/posts/netlify/2020-06-08/publishing-jigsaw-posts-with-netlify-build-hooks/index.html +++ b/www/posts/netlify/2020-06-08/publishing-jigsaw-posts-with-netlify-build-hooks/index.html @@ -22,7 +22,7 @@

Publishing Jigsaw Posts With Netlify Build Hooks

Mon 8th June 2020 By David T. Sadler.

A previous post talks about how I use Jigsaw's filtering to schedule future posts. However because Jigsaw is a static site builder I have to run Jigsaw in order to generate the HTML for the site. So if for example I have scheduled three posts to be published over three consecutive weeks I would need to build and deploy the site on each of the scheduled dates in order for the posts to be published. This kind of defeats the point of scheduling posts. So what I needed was some way to automatically trigger new builds of the site and since I use Netlify to host the site I can make use of their build hooks to do this.

For those that don't know build hooks are URLs you can use to trigger new builds and deployments in Netlify. By making a HTTP POST request to a URL, Netlify will pull down the latest master branch of your site, build it, and then deploy it.

Creating the build hook was simple. After logging into my Netlify account I went to Settings > Build & deploy > Continuous deployment > Build hooks.

From there I clicked Add build hook where I could then provide a name and select which GitHub branch would be used to build the site.

Clicking Save creates the build hook and you are given a unique URL that can be used to trigger it.

What is very handy about Netlify is that they provide you with an example of calling the URL with cURL. With this I simply setup a cron on a server that requests this URL every Monday at 8am.

8 * * 1 curl -X POST -d {} https://api.netlify.com/build_hooks/111111111111111111111111

The result is that every week posts that have been scheduled for that day will now be published when the site is built and deployed by the build hook.

Links

2020-06-01 - Scheduling Posts in JigsawJigsaw - Static Site Generator for PHP Developers.Netlify - Serverless Platform for Static Websites.Build Hooks in Netlify.Netlify - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + diff --git a/www/posts/netlify/index.html b/www/posts/netlify/index.html index 8ede82c..a53971a 100644 --- a/www/posts/netlify/index.html +++ b/www/posts/netlify/index.html @@ -22,7 +22,7 @@

The Home of David T. Sadler - All Posts About Netlify

2020-06-08 - Publishing Jigsaw Posts With Netlify Build Hooks

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + diff --git a/www/posts/nextcloud/2021-02-15/accessing-nextcloud-with-webdav-on-arch/index.html b/www/posts/nextcloud/2021-02-15/accessing-nextcloud-with-webdav-on-arch/index.html index 823371e..0f8e52c 100644 --- a/www/posts/nextcloud/2021-02-15/accessing-nextcloud-with-webdav-on-arch/index.html +++ b/www/posts/nextcloud/2021-02-15/accessing-nextcloud-with-webdav-on-arch/index.html @@ -22,7 +22,7 @@

Accessing Nextcloud With WebDAV on Arch

Mon 15th February 2021 By David T. Sadler.

I have a Nextcloud instance and I want to mount it as a directory on my local machine. Since Nextcloud cloud supports the WebDAV protocol its possible to do this by installing davfs2 which can mount a WebDAV resource.

The first thing I had to do was install davfs2.

$ sudo pacman -S davfs2

Next I created the directory where Nextcloud would be mounted.

$ mkdir -p .local/share/nextcloud

I then needed to tell Arch how to mount Nextcloud by adding the below line to the /etc/fstab file.

https://my-nextcloud-server.com/path /home/david/.local/share/nextcloud davfs rw,user,uid=david,noauto 0 0

Since access to Nextcloud is controlled by a username and password these where added to the ~/.davfs2 file.

https://my-nextcloud-server.com/path username password

I made sure this file had the correct permissions to ensure security.

$ chmod 600 ~/.davfs2/secrets

Now I can mount Nextcloud and access my files just like any others.

$ mount .local/share/nextcloud

Links

Nextcloud - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + diff --git a/www/posts/nextcloud/index.html b/www/posts/nextcloud/index.html index 4a2f2ca..34ecd39 100644 --- a/www/posts/nextcloud/index.html +++ b/www/posts/nextcloud/index.html @@ -22,7 +22,7 @@

The Home of David T. Sadler - All Posts About Nextcloud

2021-02-15 - Accessing Nextcloud With WebDAV on Arch

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + diff --git a/www/posts/php/2021-01-18/installing-php-8-for-windows-10/index.html b/www/posts/php/2021-01-18/installing-php-8-for-windows-10/index.html index 457a7af..1b5bdf5 100644 --- a/www/posts/php/2021-01-18/installing-php-8-for-windows-10/index.html +++ b/www/posts/php/2021-01-18/installing-php-8-for-windows-10/index.html @@ -26,7 +26,7 @@ PHP 8.0.1 (cli) (built: Jan 5 2021 23:43:33) ( NTS Visual C++ 2019 x64 ) Copyright (c) The PHP Group Zend Engine v4.0.1, Copyright (c) Zend Technologies

Links

PHP For Windows.PHP - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. - - + + diff --git a/www/posts/php/index.html b/www/posts/php/index.html index f94951e..fbf98a8 100644 --- a/www/posts/php/index.html +++ b/www/posts/php/index.html @@ -22,7 +22,7 @@

The Home of David T. Sadler - All Posts About PHP

2021-01-18 - Installing PHP 8 for Windows 10

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.
- - + + -- cgit v1.2.3-13-gbd6f