Skip to content

Instantly share code, notes, and snippets.

View vzool's full-sized avatar
🎯
Focusing

Abdelaziz Elrashed vzool

🎯
Focusing
View GitHub Profile
@vzool
vzool / gist:a3133b57c09ef4fcbea005d0c991e723
Created April 2, 2018 07:07 — forked from kapkaev/gist:4619127
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. Resque
$ redis-cli
> config set stop-writes-on-bgsave-error no
@vzool
vzool / main.go
Last active April 11, 2018 18:29
This is an example for Pyramid Hierarchy URL routes implemented using [Bone](https://github.com/go-zoo/bone)
package main
import (
"fmt"
"net/http"
"github.com/go-zoo/bone"
)
func main() {
@vzool
vzool / Synology-Diskstation-Git.md
Created June 20, 2018 11:04 — forked from walkerjeffd/Synology-Diskstation-Git.md
Instructions for setting up git server on Synology Diskstation

Configure Synology NAS as Git Server

Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.

Set Up User and Folder

  • Create user gituser via Diskstation interface (with File Station and WebDAV privilages)
  • Add new shared folder called git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.
  • Install Git Server package via Diskstation
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*
chmod 644 ~/.ssh/*.pub
@vzool
vzool / gist:cb226889f39ba0e3729f4e0a9de4623d
Created August 3, 2018 16:05 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@vzool
vzool / git.alias.sh
Last active February 12, 2022 09:34
Alias to push all branches to all remotes with just `git pushall`
#/bin/bash
git config --global alias.pushall '!git remote | xargs -L1 git push --all'
@vzool
vzool / publish-chronicle.php
Created October 18, 2018 22:00
Publish Client to chronicle
<?php
$root = \dirname(__DIR__);
/** @psalm-suppress UnresolvableInclude */
require_once $root . '/cli-autoload.php';
use GuzzleHttp\Client;
use ParagonIE\Sapient\Sapient;
use ParagonIE\Chronicle\Chronicle;
use ParagonIE\ConstantTime\Base64UrlSafe;
@vzool
vzool / a_phar.md
Created November 14, 2018 19:11
Create a PHP Phar file

Create a PHP Phar file

Run: php create-phar.php

app.phar successfully created

Start a phar file

Run: php app.phar

import base64
import random as r
MAX_VALUE = 256 * 9
private_key = int(r.random() * MAX_VALUE)
public_key = MAX_VALUE - private_key
shared_key = MAX_VALUE
print("Public Key: %d" % public_key)
@vzool
vzool / gitlab-webhook-push.php
Created February 20, 2019 06:56 — forked from pitchart/gitlab-webhook-push.php
A simple php script to manage gitlab push webhook
<?php
/**
* GitLab Web Hook
* See https://gitlab.com/kpobococ/gitlab-webhook
*
* This script should be placed within the web root of your desired deploy
* location. The GitLab repository should then be configured to call it for the
* "Push events" trigger via the Web Hooks settings page.
*
* Each time this script is called, it executes a hook shell script and logs all