Skip to content

Instantly share code, notes, and snippets.

@Norcoen
Norcoen / download-site.md
Created Mar 19, 2021 — forked from pmeinhardt/download-site.md
download an entire page (including css, js, images) for offline-reading, archiving… using wget
View download-site.md

If you ever need to download an entire website, perhaps for off-line viewing, wget can do the job — for example:

$ wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains website.org --no-parent  www.website.org/tutorials/html/

This command downloads the website www.website.org/tutorials/html/.

The options are:

  • --recursive: download the entire website
  • --domains website.org: don't follow links outside website.org
@Norcoen
Norcoen / Arch Linux, Fedora
Created Feb 14, 2021 — forked from elvetemedve/Arch Linux, Fedora
Allow Vagrant usage without providing sudo password
View Arch Linux, Fedora
sudo tee /etc/sudoers.d/vagrant > /dev/null << EOL
#
# Arch Linux, Fedora sudoers entries
#
# Allow passwordless startup of Vagrant with vagrant-hostsupdater.
Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c echo "*" >> /etc/hosts
Cmnd_Alias VAGRANT_HOSTS_REMOVE = /usr/bin/sed -i -e /*/ d /etc/hosts
%sudo ALL=(root) NOPASSWD: VAGRANT_HOSTS_ADD, VAGRANT_HOSTS_REMOVE
@Norcoen
Norcoen / generate-ssh-key.sh
Created Jan 29, 2021 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
View generate-ssh-key.sh
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@Norcoen
Norcoen / gitlab-webhook-push.php
Created Nov 12, 2020 — forked from pitchart/gitlab-webhook-push.php
A simple php script to manage gitlab push webhook
View gitlab-webhook-push.php
<?php
/**
* GitLab Web Hook
* See https://gitlab.com/kpobococ/gitlab-webhook
*
* This script should be placed within the web root of your desired deploy
* location. The GitLab repository should then be configured to call it for the
* "Push events" trigger via the Web Hooks settings page.
*
* Each time this script is called, it executes a hook shell script and logs all
View opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost
@Norcoen
Norcoen / SoapClientCurl.php
Created Mar 19, 2019 — forked from stefanvangastel/SoapClientCurl.php
PHP 5.3 SoapClient with cURL request
View SoapClientCurl.php
/**
* Class SoapClientCurl extends SoapClient __doRequest method with curl powered method
*/
class SoapClientCurl extends SoapClient{
//Required variables
public $url = null;
public $certfile = null;
public $keyfile = null;
public $passphrase = null;
@Norcoen
Norcoen / realurl_conf.php
Created Jan 28, 2019 — forked from lorenzulrich/realurl_conf.php
TYPO3 RealURL: Two sites in an installation, both with one domain per language
View realurl_conf.php
<?php
$realUrlSiteConfigurations = [
'site1' => [
'rootPageUid' => 1,
'schema' => 'https',
'languageDomainMap' => [
0 => 'www.site1.ch',
1 => 'www.site1.fr',
2 => 'www.site1.it',
]
@Norcoen
Norcoen / debian-stretch-fde.md
Created Jan 12, 2019 — forked from ppmathis/debian-stretch-fde.md
Guide which explains an installation of Debian Stretch with full disk encryption (including "/boot" partition, containing initramfs+kernel) by using Debian Jessie Live.
View debian-stretch-fde.md

Debian Stretch - Full Disk Encryption

This documents guides you through the process to install Debian Stretch with Full Disk Encryption. The following requirements exist:

  • Mainboard with UEFI-Support
  • Debian Stretch Live CD booted from UEFI
  • Two unformatted, unpartitioned HDDs/SSDs for Software RAID1 with mdmadm

After following this guide, you will end up with a setup like this:

  • Redundant GRUB Standalone EFI installation on both disks
@Norcoen
Norcoen / SolrTYPO3.md
Created Nov 26, 2018 — forked from fedir/SolrTYPO3.md
TYPO3 Solr extension configuraiton sample
View SolrTYPO3.md

Constants

plugin.tx_solr {
	solr {
	scheme = http

	host = YY.YY.YY.YY
	port = 8080

	path = /solr/core_XXXX/
@Norcoen
Norcoen / PartialExistsViewHelper.php
Created Oct 14, 2018 — forked from arnekolja/PartialExistsViewHelper.php
TYPO3 Fluid ViewHelper to check if a partial name exists ("My/Partial")
View PartialExistsViewHelper.php
<?php
namespace Krbu\Utility\ViewHelpers;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
/**
* Copyright note: Some parts are copied from the Fluid package.
* Usage example:
* <f:if condition="{krbu:PartialExists(partial: 'Category/{item.category.id}/DetailCol1')}">