Skip to content

Instantly share code, notes, and snippets.

@techpulsetoday
techpulsetoday / how-to-execute-a-bash-script-from-github-gist.md
Last active December 11, 2023 08:12
Execute bash script directly from URL

Execute bash script directly from a URL

bash <(curl -Ls https://example.com/script.sh)
bash <(curl -Ls https://raw.githubusercontent.com/techpulsetoday/scripts/master/vim-bootstrap)

Passing Parameters to bash when executing a script fetched by curl

curl https://example.com/script.sh | bash -s arg1 arg2 arg3
curl https://raw.githubusercontent.com/techpulsetoday/scripts/master/virtualhost | sudo bash -s create local.techpulsetoday.com /var/www/html/local.techpulsetoday.com/
@techpulsetoday
techpulsetoday / breadcrumbs-code-without-plugin.php
Last active June 11, 2021 14:23
By adding this to functions.php to display the menu, just use this function to display it wherever you want.
<?php
/*=============================================
BREADCRUMBS
=============================================*/
// to include in functions.php
function the_breadcrumb()
{
$showOnHome = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show
$delimiter = '&raquo;'; // delimiter between crumbs
$home = 'Home'; // text for the 'Home' link
@techpulsetoday
techpulsetoday / ngxdis
Created December 21, 2018 17:48 — forked from fideloper/ngxdis
Nginx scripts for enable and disabling a site. This will create or destroy a symlink between a real config file in /etc/nginx/sites-available and a symlink in /etc/nginx/sites-enabled.
#!/usr/bin/env bash
if [ $EUID -ne 0 ]; then
echo "You must be root: \"sudo ngxdis\""
exit 1
fi
# -z str: Returns True if the length of str is equal to zero.
if [ -z "$1" ]; then
echo "Please choose a site."