Skip to content

Instantly share code, notes, and snippets.

View rehmatworks's full-sized avatar
👨‍💻
python manage.py domagic

Rehmat Alam rehmatworks

👨‍💻
python manage.py domagic
View GitHub Profile
@rehmatworks
rehmatworks / tokdis.sh
Last active August 22, 2017 09:55
A simple script to easily install token dispenser on an Ubuntu server
#!/bin/bash
################################################################
# A simple script to install Token Dispenser on an Ubuntu server
# Author: Rehmat Alam
# Website: https://supportivehands.net
################################################################
read -p "Gmail ID: " gmailAddress
read -p "Account Password: " accountPassword
read -p "Server's Public IP: " serverIP
#!/usr/bin/php
<?php
#########################################################
# Name: WebDav Recursive Upload #
# Description: Uploads files and directories #
# to a remote WebDav machine recursively #
# Author: Rehmat Alam #
# Website: https://rehmat.works #
#########################################################
@rehmatworks
rehmatworks / ufr.sh
Last active September 14, 2017 17:38
#!/bin/bash
printf "Original String: "
read -r ufr_oristring
if [[ -z "$ufr_oristring" ]]
then
echo -e "\e[31mPlease provide the original string that needs to be replaced\e[39m"
exit
fi
printf "New String (This will replace the Original String): "
@rehmatworks
rehmatworks / android-apps-games-categories-as-json.json
Last active February 2, 2018 12:21
I took these categories (main and sub-categories) from an official page of Google and transformed them into a JSON file. The purpose was to use these categories in my Android Apps and Games Market website https://apkbucket.net. I'm putting this as a gist for public with an intention that this might help someone else too.
[
{
"name": "Apps",
"children": [
{
"name": "Art & Design",
"description": "Sketchbooks, painter tools, art & design tools, coloring books"
},
{
"name": "Auto & Vehicles",
@rehmatworks
rehmatworks / spatie-laravel-role-permission-example.php
Last active July 20, 2018 11:01
An example usage of Spatie role and permissions for Laravel
<?php
use App\User;
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;
$editorRole = Role::create(['name' => 'Editor']);
$userRole = Role::create(['name' => 'User']);
$adminRole = Role::create(['name' => 'Admin']);
// Permissions
@rehmatworks
rehmatworks / install.sh
Created June 25, 2019 17:46
Test Apache Install via API
#!/bin/bash
apt-get update
apt-get install apache2
@rehmatworks
rehmatworks / serverpack-installer.sh
Last active July 20, 2019 10:49
serverpack-installer.sh
#!/bin/bash
sudo yum update -y
sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager
sudo yum remove NetworkManager -y
sudo systemctl stop firewalld
sudo systemctl disable firewalld
sudo yum remove firewalld -y
sudo curl -o /home/latest -L https://securedownloads.cpanel.net/latest
sudo chmod +x /home/latest
@rehmatworks
rehmatworks / readme.md
Last active October 12, 2019 18:33
Django install instructions

This guide is intended to deploy a Django application on an Ubuntu 18.x server from a Git repo. This is written for a specific client's needs only and this is not intended for public help.

Step 1: Install needed packages

sudo apt-get install nginx mysql-server software-properties-common libmysqlclient-dev virtualenv

Step 2: Create a system user with sudo privileges if you are signed in as root

@rehmatworks
rehmatworks / mediafire-downloader-help.md
Last active March 19, 2020 15:44
A simple Python script to download files from Mediafire to PC or server.

Download Mediafire files to PC or Server

The script relies on two dependencies:

  1. Python Requests
  2. BeautifulSoup4

Install the dependencies by running:

pip3 install requests
pip3 install bs4
@rehmatworks
rehmatworks / itunes-category-list.json
Last active November 20, 2020 16:41
I needed the up-to-date list of iTunes categories (as of 2017) for a project but didn't find the list as a JSON anywhere. Here I'm sharing the latest categories list that I extracted from iTunes official page. I hope this helps someone.
{
"1": {
"name": "Arts",
"sub": [
"Design",
"Fashion & Beauty",
"Food",
"Literature",
"Performing Arts",
"Visual Arts"