Skip to content

Instantly share code, notes, and snippets.

View 101t's full-sized avatar
🐍
Simple is better than complex!

Tarek Kalaji 101t

🐍
Simple is better than complex!
View GitHub Profile
@101t
101t / Useful command line for Linux.md
Last active September 19, 2023 03:56
Frequently useful commands in Linux

Cleaning *.pyc files in terminal

find . -name "*.pyc" -exec rm -rf {} \;

or use this:

find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf

source: link

# -*- coding: utf-8 -*-
"""
Verify the given mail id is valid or not without sending mail. Verifying the email id directly from mail exchange server.
"""
import argparse
import smtplib
import dns.resolver
import re
@101t
101t / Django installations on Ubuntu.md
Last active December 6, 2023 14:56
Quick Start with Django installations on Ubuntu

Django installations on Ubuntu

Installing Python in system

First step install dependencies.

sudo apt-get install git python-setuptools python-pip python-dev \
&& sudo apt-get install python3-pip python3-dev virtualenv

then install local envirement of Django project.

@101t
101t / Django Deployment on Ubuntu Server.md with Apache2.md
Last active May 23, 2023 20:12
Quick Start with Django Deployment on Ubuntu

Django Deployment on Ubuntu Server

Step 1:

install and edit django.wsgi.

sudo apt-get install libapache2-mod-wsgi
nano django.wsgi

Inside nano editor write the following codes

@101t
101t / ping.py
Created November 14, 2015 08:54 — forked from pklaus/ping.py
A pure python ping implementation using raw socket.
#!/usr/bin/env python2
"""
Other Repositories of python-ping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* https://github.com/l4m3rx/python-ping supports Python2 and Python3
* https://bitbucket.org/delroth/python-ping
#/bin/bash
# Update the ldconfig configuration file.
touch /etc/ld.so.conf.d/x86_64-linux-freeswitch.conf
echo "/usr/local/lib" >> /etc/ld.so.conf.d/x86_64-linux-freeswitch.conf
# Install libyuv-dev
cd /usr/src
wget http://files.freeswitch.org/downloads/libs/libyuv-0.0.1280.tar.gz
tar -xzvf libyuv-0.0.1280.tar.gz
cd libyuv-0.0.1280
@101t
101t / process-rxfax.py
Created December 7, 2016 15:10
the script uses the UUID from freeswitch to make a unique filename on the server while receiving, then renames the attachment to a friendly name for the emailed user. The script calls tiff2ps and ps2pdf to create a PDF from the initial TIFF from spandsp.
#!/usr/local/bin/python
#
# process-rxfax.py - post process incoming fax from freeswitch (spandsp raw .tiff => pdf, then
# emailed)
#
# the script uses the UUID from freeswitch to make a unique filename on the server while receiving,
# then renames the attachment to a friendly name for the emailed user. The script calls tiff2ps
# and ps2pdf to create a PDF from the initial TIFF from spandsp.
#
import sys # import the sys module for argv
@101t
101t / nodejs-notes.md
Last active February 18, 2019 18:17
NodeJS Installation Quick Start

NodeJS

Node installation and required dependencies

NodeJS, to install NodeJS packages in this example we will use Ubuntu 14.04 TLS as OS example and expressjs as node package example, Ubuntu 16.04 TLS contains a version of Node.js in its default repositories.

apt-get update && apt-get upgrade
apt-get install nodejs

to check nodejs version

node -v
@101t
101t / Laravel 5 tutorial.md
Last active May 31, 2020 10:06
Laravel 5 simple Tutorial

PHP / WordPress / Laravel

PHP

Correcting file permissions on server

chown www-data:www-data -R * # Let Apache be owner
find . -type d -exec chmod 755 {} \;  # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 644 {} \;  # Change file permissions rw-r--r--

According to: StackOverflow Answer

@101t
101t / Git-Commands.md
Last active August 4, 2023 06:09
Git Commands Hot and simple tutorials

Git repositories with Submodules

clone new repository with submodules

git clone --recurse-submodules -j8 git://github.com/foo/bar.git

Source: here

Update sub-repositories in main repository tree

git submodule update --remote --merge