Skip to content

Instantly share code, notes, and snippets.

View svetlio's full-sized avatar

Svetoslav Stoyanov svetlio

View GitHub Profile
@MiroXP
MiroXP / Ubuntu 22.04 de FortiClient "Backup routing table failed".md
Created January 8, 2023 20:46
FortiClient "Backup routing table failed"

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''

  1. Create script 'systemd-resolve'
  2. Store under '/usr/bin/systemd-resolve'
  3. Make executable 'chmod +x /usr/bin/systemd-resolve'
@crittermike
crittermike / import.php
Last active April 15, 2025 18:49
Importing Drupal 8 config programmatically
<?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');
@keopx
keopx / settings.local.php
Last active August 28, 2024 06:24
Drupal 8 Redis settings.local.php
<?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';
@reinis-kinkeris
reinis-kinkeris / my_module.module
Last active February 8, 2024 11:40
Drupal 8 - Example of adding dynamic js libraries which require locale
/**
* Implements hook_library_info_build().
*
* @return array
*/
function hook_library_info_build() {
$libraries = [];
/** @var \Drupal\Core\Language\LanguageManager $language_manager */
$language_manager = \Drupal::languageManager();
@wizioo
wizioo / gitignore_per_git_branch.md
Last active April 19, 2025 04:57
HowTo have specific .gitignore for each git branch

How to have specific .gitignore for each git branch

Objective

My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.

Solution

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.

@iamravenous
iamravenous / jquery.smooth-scroll-anchor-link.js
Last active April 24, 2024 03:18
Automatically detects the hash and scroll smoothly to anchor link with URL hashchange
@Nilpo
Nilpo / Using Git to Manage a Live Web Site.md
Last active April 18, 2025 15:39
Using Git to Manage a Live Web Site

Using Git to Manage a Live Web Site

Overview

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.

Contents

@alexklibisz
alexklibisz / apache-reverse-proxy.conf
Created May 25, 2015 19:20
Apache Port Forward / Reverse Proxy Config
# 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
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active April 14, 2025 11:07
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
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