Skip to content

Instantly share code, notes, and snippets.

View sajjadG's full-sized avatar
☺️
Feeling Good

Sajjad Gerami sajjadG

☺️
Feeling Good
View GitHub Profile
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@pankajp
pankajp / serve_http.py
Last active February 5, 2024 17:51
Simple Python HTTP Server with multi-threading and partial-content support
#! /usr/bin/env python
# Standard library imports.
from SocketServer import ThreadingMixIn
import BaseHTTPServer
import SimpleHTTPServer
import sys
import json
import os
from os.path import (join, exists, dirname, abspath, isabs, sep, walk, splitext,
@devster31
devster31 / swap.yml
Last active February 28, 2024 10:43 — forked from manuelmeurer/swap.yml
Ansible role for creating a Swap file
- name: set swap_file variable
set_fact:
swap_file: /{{ swap_space }}.swap
- name: check if swap file exists
stat:
path: "{{ swap_file }}"
register: swap_file_check
- name: create swap file
@yannhowe
yannhowe / .gitlab.ci.yml
Created September 26, 2016 18:06
.gitlab.ci.yml for SSH with private key.
# Image neeeds to have ssh-client
image: docker:git
services:
- docker:dind
stages:
- staging
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
version: '2'
services:
roach-ui:
image: cockroachdb/cockroach:beta-20161215
command: start --insecure
ports:
- 8080:8080
networks:
- roachnet
@fabiomontefuscolo
fabiomontefuscolo / xz.markdown
Last active March 21, 2024 22:01
XZ and tricks

XZ

  1. Compress a file (filename.sql will be replaced by filename.sql.xz)
xz filename.sql
  1. Uncompress file (filename.sql.xz will be replaced by filename.sql)
@aleksandar-babic
aleksandar-babic / nginx-vhost.conf
Created June 20, 2018 09:20
Wordpress behind NGINX reverse proxy
location /blog/ {
#auth_basic "Restricted";
#auth_basic_user_file /etc/nginx/.htpasswd;
proxy_pass https://test-blog.bitstarz.com/;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
@rsperl
rsperl / Makefile #snippet
Last active April 17, 2024 23:02
self-documenting makefile with colors
SHELL=/bin/bash
# to see all colors, run
# bash -c 'for c in {0..255}; do tput setaf $c; tput setaf $c | cat -v; echo =$c; done'
# the first 15 entries are the 8-bit colors
# define standard colors
ifneq (,$(findstring xterm,${TERM}))
BLACK := $(shell tput -Txterm setaf 0)
RED := $(shell tput -Txterm setaf 1)
@Oratorian
Oratorian / create-cloud-template.sh
Last active January 4, 2023 21:07 — forked from chriswayg/create-cloud-template.sh
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1
@sajjadG
sajjadG / create-cloud-template.sh
Last active May 9, 2021 19:13 — forked from Oratorian/create-cloud-template.sh
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr0