As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
| # Running some application on port 8080, want to make it | |
| # available at subdomain.example.com | |
| <VirtualHost *:80> | |
| ServerAdmin webmaster@localhost | |
| ServerName subdomain.example.com | |
| ProxyPreserveHost On | |
| # setup the proxy | |
| <Proxy *> | |
| Order allow,deny |
| /* | |
| * Smooth scroll to anchor link | |
| * Automatically detects the hash and scroll smoothly to anchor link with URL hashchange | |
| * Author: Franco Moya - @iamravenous | |
| */ | |
| // If you need more autonomy, | |
| // You can replace hash detection with a data-attribute | |
| // e.g. $("[data-scroll='smooth']") |
My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.
My solution is to make a general .gitignore file and add .gitignore.branch_name files for the branches I want to add specific file exclusion.
I'll use post-checkout hook to copy those .gitignore.branch_name in place of .git/info/exclude each time I go to the branch with git checkout branch_name.
| /** | |
| * Implements hook_library_info_build(). | |
| * | |
| * @return array | |
| */ | |
| function hook_library_info_build() { | |
| $libraries = []; | |
| /** @var \Drupal\Core\Language\LanguageManager $language_manager */ | |
| $language_manager = \Drupal::languageManager(); |
| <?php | |
| /** | |
| * Set redis configuration. | |
| */ | |
| /** @see: https://docs.platform.sh/frameworks/drupal8/redis.html */ | |
| if (extension_loaded('redis')) { | |
| // Set Redis as the default backend for any cache bin not otherwise specified. | |
| // $settings['cache']['default'] = 'cache.backend.redis'; |
| <?php | |
| // Import arbitrary config from a variable. | |
| // Assumes $data has the data you want to import for this config. | |
| $config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html'); | |
| $config->setData($data)->save(); | |
| // Or, re-import the default config for a module or profile, etc. | |
| \Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module'); |
FortiClient "Backup routing table failed"
Can't establish an SSL-VPN connection with the FortiClient since the update to Ubuntu 22.04. The log ('ssvpn.log') says 'Backup routing table failed'. I found the solution on the following website. ''https://tr.linkedin.com/posts/muratsuluhan_ubuntu-2204-de-forticlient-backup-routing-activity-6972928492078264320-Yt_X?trk=public_profile_like_view''
- Create script 'systemd-resolve'
- Store under '/usr/bin/systemd-resolve'
- Make executable 'chmod +x /usr/bin/systemd-resolve'