Skip to content

Instantly share code, notes, and snippets.

View YasienDwieb's full-sized avatar

Yasien Dwieb YasienDwieb

View GitHub Profile
@YasienDwieb
YasienDwieb / ImageUpload.vue
Created November 20, 2017 07:49
A Vue component that can be used within form to add image upload and thumbnail view functionality
<template>
<div>
<span class="btn btn-file">
<i class="fa fa-camera"></i>
<input name="image" type="file" @change="onFileChange" accept="image/*">
</span>
<div v-if="uploadImage" class="replyImage">
<img :src="uploadImage" />
<button @click="removeImage"><i class="fa fa-close"></i></button>
</div>
@YasienDwieb
YasienDwieb / linux-provisioning.sh
Last active April 23, 2019 21:57
Linux Packages installation assistant
#!/bin/bash
#This script works on preparing a clean linux distro to be ready
#for being used for developemnt
#Author: Yasien
while [ true ];do
#Getting input from user about desired operation
cat << EOT
Please Choose an option:
@YasienDwieb
YasienDwieb / dev-progs.sh
Created September 30, 2018 11:21
Development programs installation script
#!/bin/sh
#Developement programs installation script
#Author: Yasien
sudo apt update
#sublime
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
@YasienDwieb
YasienDwieb / nlargest.sh
Last active October 20, 2019 12:43
Find largest files or directories
#!/bin/bash
if [ $# -eq 0 ]
then
echo 'Usage:largest.sh file|folder path NUMBEROFRECORDS'
exit
fi
DEST=$2
NUMBEROFRECORDS=10
if [ -n $3 ]
@YasienDwieb
YasienDwieb / audio_splitter.sh
Created January 12, 2019 22:08
split audio files into equal pieces using ffmpeg
#!/bin/bash
if [ $# -eq 0 ]
then
echo 'Usage: audiosplitter.sh filename|directory segmenttime'
exit
fi
FILENAME=$1
SEGMENTTIME=$2
@YasienDwieb
YasienDwieb / ar2en.py
Created January 13, 2019 09:43
Franco Arabic onvertor to english (Has been totally copied)
#!/usr/bin/env python
# coding: utf-8
# ar2en.py : Renames arabic files and directories into english recursively
import os
import sys
import shutil
chart = { "أ" : "a" ,
"ا" : "a" ,
@YasienDwieb
YasienDwieb / .aliases
Last active September 22, 2019 12:04
Linux most used aliases
# aliases
alias gs='git status'
alias gl="git log --graph --pretty=format:'%C(yellow)%d%Creset %C(cyan)%h%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=short --all"
alias gc='git add . & git commit -m '
@YasienDwieb
YasienDwieb / isomaker.sh
Last active September 10, 2025 23:12
Bulk iso files maker useful for courses archiving for easy transfer and quick view
#!/bin/bash
if [ -z $2 ]; then
echo $0" <source-dir/> <dist-dir/>"
exit
fi
IFS=$'\n'
SOURCE=$1
DEST=$2
for dir in `ls $SOURCE |rev |cut -d '/' -f1 |rev`;do
@YasienDwieb
YasienDwieb / killProcessesByUsedPort.sh
Last active February 23, 2020 10:13
Solves port already in use issue by killing processes that use that port
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Usage: $0 <port>"
exit
fi
for i in `sudo lsof -i :8080| sed 's/\( \)*/\1/g' | cut -d" " -f2| sort | uniq| egrep -o '[0-9]*'`;do
sudo kill -9 $i
done
@YasienDwieb
YasienDwieb / rsync-scp.sh
Last active March 27, 2022 12:32
Sync files with remote server while excluding .git folder
#!/bin/bash
if [ $# -lt 2 ]
then
echo "Usage: $0 <src> <dst> [any-rsync-option]"
exit
fi
rsync -aruvzp --progress --exclude='.git/' $@