Skip to content

Instantly share code, notes, and snippets.

View w3servicesdotnet's full-sized avatar

W3SERVICES w3servicesdotnet

View GitHub Profile
@mhawksey
mhawksey / gist:1276293
Last active February 28, 2025 08:52
Google App Script to insert data to a google spreadsheet via POST or GET - updated version as per https://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@gembry
gembry / devDude_htaccess
Created July 10, 2012 22:43
.htaccess file w/ RewriteBase setup
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
@hzbd
hzbd / haproxy.config
Created May 4, 2013 17:34
Sample HAProxy config with logging.
global
pidfile /var/run/haproxy.pid
log 127.0.0.1 local0 info
ulimit-n 65536
defaults
mode http
clitimeout 600000 # maximum inactivity time on the client side
srvtimeout 600000 # maximum inactivity time on the server side
@mattmezza
mattmezza / vhost.sh
Last active September 29, 2024 03:39
bash script to create virtual host vhost with apache httpd and CentOs 7
#!/bin/bash
# This script is used for create virtual hosts on CentOs.
# Created by alexnogard from http://alexnogard.com
# Improved by mattmezza from http://you.canmakethat.com
# Feel free to modify it
# PARAMETERS
#
# $usr - User
# $dir - directory of web files
# $servn - webserver address without www.
@CarsonF
CarsonF / composer.sh
Last active January 19, 2024 11:10
Global Composer Setup
#!/usr/bin/env bash
# As root
# Make config and data dirs
mkdir /etc/composer -p || exit 1
mkdir /var/lib/composer -p
# Set composer home dir to global location
cat << EOF > /etc/profile.d/composer.sh
#!/usr/bin/env bash
@alrik11es
alrik11es / manage-etc-hosts.sh
Last active April 27, 2021 12:29 — forked from stvvt/manage-etc-hosts.sh
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/usr/bin/env bash
set -eu
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# PATH TO YOUR HOSTS FILE
@worldadventurer
worldadventurer / change-ssh-port.sh
Last active December 24, 2024 01:53
Change SSH Port - prompts on command line for new port number
#!/bin/bash
# Copied from https://github.com/FreePBXHosting/freepbx-scripts/tree/master/sshport
#
# To run the script, login as root via SSH and run the following command:
# bash <(curl -Ls https://gist.github.com/worldadventurer/842f1a10762cba0ce27dc8f99a835377/raw)
#
#############################################
# FreePBXHosting.com - @freepbxhosting #
# VERSION 1.6 UPDATED JUN 25 2015 #
# DESC: CHANGES SSH PORT AND RESTARTS SSH #
@gene1wood
gene1wood / install-duplicati-on-centos6.sh
Created January 8, 2018 06:14
How to install Duplicati on CentOS 6
# Install mono
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
yum-config-manager --add-repo http://download.mono-project.com/repo/centos6/
yum install mono-complete
# Install duplicati, ignoring dependencies
wget https://updates.duplicati.com/beta/duplicati-2.0.2.1-2.0.2.1_beta_20170801.noarch.rpm
rpm -ivh --nodeps duplicati-2.0.2.1-2.0.2.1_beta_20170801.noarch.rpm
# Create init script and enable the service
@minhazulOO7
minhazulOO7 / 0-Upgrade CyberPanel using Bash Script-readme.md
Last active October 2, 2020 04:20
A Shell Script to Upgrade CyberPanel

Upgrade CyberPanel using Bash Script

  • NO LONGER MAINTAINED!
  • This script will check for internet availability and then upgrade CyberPanel. Cyberpanel's own upgrade system is too much tedious for many users. That's why made this script.

Script Requirements

How to Use it?

Put the cpupg.sh file to anyhwere you like. E.g., /home/scripts.

  • Open terminal.

Copy/ Move CyberPanel Backup Archive(s) using Bash Script with/ without Crontab/ Systemd Timer

  • NO LONGER MAINTAINED!
  • These scripts will copy/ move CyberPanel backup archive(s) from /home/domain/backup directory to a specified directory by the user.

Script Requirements

How to Use it?

  1. There are two scripts to work with. One is cpbac_a.sh another one is cpbac_m.sh. If you want to use it with crontab/ systemd timer then cpbac_a.sh is suitable for you. If you want to use it manually with prompt (running it by yourself) then cpbac_m.sh is suitable for you.