Skip to content

Instantly share code, notes, and snippets.

View stefanpejcic's full-sized avatar
:octocat:
Live long and may the source be with you

Stefan Pejcic stefanpejcic

:octocat:
Live long and may the source be with you
View GitHub Profile
@styblope
styblope / docker-api-port.md
Last active May 3, 2024 02:08
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@sblask
sblask / ls
Created November 19, 2013 13:46
ls with list, human readable sizes, hidden files and sorting
ls -lhac
@hackerdem
hackerdem / encrypt_1.py
Created May 14, 2016 07:45
python simple encryption and database connection example
from passlib.hash import pbkdf2_sha256
import getpass
import mysql.connector
def enc_pass(pwd):
hash=pbkdf2_sha256.encrypt(pwd,rounds=200,salt_size=16)
return hash
def con_database(pwd):
cnx=mysql.connector.connect(user='*****',password='*****',host='*******',database='******')
cursor=cnx.cursor()
try:
@leandronsp
leandronsp / 001-server.bash
Last active February 28, 2024 19:44
A complete yet simple Web server (with login & logout system) written in Shell Script
#!/bin/bash
## Create the response FIFO
rm -f response
mkfifo response
function handle_GET_home() {
RESPONSE=$(cat home.html | \
sed "s/{{$COOKIE_NAME}}/$COOKIE_VALUE/")
}
@richardjoo
richardjoo / how-to-manage-exim.md
Last active December 1, 2023 07:25
my most frequently used exim commandlines
  • Print a count of the messages in the queue:

    exim -bpc

  • How to resend frozen messages in exim4 queue

    exim -bp | grep frozen | awk '{print $3}' | xargs exim -v -M

  • Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient):

@rushipkar90
rushipkar90 / rushi.txt
Last active June 1, 2023 19:07
rushi.txt
prestashop - 500 error
===================
https://www.prestashop.com/forums/topic/421126-request-exceeded-the-limit-of-10-internal-redirects-due-to-probable-configuration-error/
===================
CloudFlare installation:
==========
http://www.cpanelkb.net/cloudflare-plugin-install/
http://crybit.com/install-cloudflare-plugin-on-cpanel/
http://stackoverflow.com/questions/23860877/how-to-install-cloudflare-on-cpanel-servers
@EricBusch
EricBusch / deploy.sh
Last active April 15, 2023 13:10
Deploy your plugin to the WordPress.org SVN plugin repository from your GitHub Repository.
#! /bin/bash
#
# Script to deploy from Github to WordPress.org Plugin Repository
# A modification of a number of different sources:
# @link https://github.com/deanc/wordpress-plugin-git-svn
# @link https://github.com/GaryJones/wordpress-plugin-svn-deploy
# @link https://github.com/thenbrent/multisite-user-management/blob/master/deploy.sh
#
# Accompanying Tutorial Here:
# @link https://ericbusch.net/?p=106
@irazasyed
irazasyed / common-cPanel-WHM-paths.md
Last active April 7, 2023 14:35
Common paths in cPanel and WHM, Useful for regular use. Source: http://www.webhostingbuzz.com/wiki/common-paths-cpanel-and-whm/ Note: I don't take any credits for this article (All credits go to the author who published it), I've just converted into markdown format for regular reference (Personal preference).

Common paths in cPanel and WHM


For those users who use cPanel/WHM on their virtual or dedicated servers the following article describes common system paths and utilities.

Paths of Base Modules


PHP /usr/bin/php

@Ara4Sh
Ara4Sh / cloudflare-failover.sh
Created October 12, 2016 13:49
CloudFlare A records failover script using CloudFlare api v4 (https://api.cloudflare.com) required jq and curl to run.
#!/bin/bash
# Copyright (C) 2016 Arash Shams <https://github.com/Ara4Sh>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@beatwiz
beatwiz / cleartrash.sh
Last active April 22, 2022 12:13
[bash] cPanel / WHM Cron bash script to delete all accounts > domains > users, trash / spam / junk emails with more than 30 days
#!/bin/bash
# All users from all domains from all accounts in /home
MAILDIRS=$(find /home/*/mail/ -type d)
# Only .Trash .Junk .Spam folders
INBOXFOLDERS=(.Trash .Junk .spam)
for basedir in $MAILDIRS; do
for ((i = 0; i < ${#INBOXFOLDERS[*]}; i++)); do
# Only cur and new folders
for dir in cur new; do
# Only if the full path to the folder exists