Skip to content

Instantly share code, notes, and snippets.

View mansouryaacoubi's full-sized avatar
🥑
FR E SH A VOCA DO

Mansour Yaacoubi mansouryaacoubi

🥑
FR E SH A VOCA DO
View GitHub Profile
@mansouryaacoubi
mansouryaacoubi / checkDNS.bat
Created September 4, 2018 09:38
Check whether MY Servers are reachable
title Checking active hosts
@echo off
color FC
:start
cls
echo Ping MYServer001...
ping -n 1 myserver001.yaacoubi.com | find "TTL=" >nul
if errorlevel 1 (
echo HOST NOT REACHABLE
timeout 3
@mansouryaacoubi
mansouryaacoubi / getWifiKey.bat
Created September 4, 2018 09:37
Batch to get WiFi Key
@echo off
set /p SSID="Please enter WiFi SSID: "
set keyfile=%SSID%_key.txt
set
echo Retrieving security key for %SSID%...
netsh WLAN show profile name="%SSID%" key=clear >%keyfile%
echo Security key was successfully saved in %keyfile%.
@mansouryaacoubi
mansouryaacoubi / setbg.sh
Last active August 10, 2018 07:47
Easy setup for Ubuntu background image (installation using /bin) [recommended]
#!/bin/bash
# @author Mansour Yaacoubi
# @filename setbg.sh
# @version 2.3
# @task Sets background in Ubuntu and some other Linux versions
# @feature When this script runs as superuser,
# the command 'setbg' can be installed into /bin directory
# @timestamp 15:53 12.06.2017
# @usage ./setbg.sh wallpaper.jpg
# su $USER -c setbg.sh wallpaper.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mansouryaacoubi
mansouryaacoubi / config-rpi.sh
Last active May 11, 2018 17:30
Configure RPi (Setup)
#!/bin/bash
# @author Mansour Yaacoubi
# @filename config-rpi.sh
################# CHECK WHETHER SCRIPT IS RUNNING AS ROOT #################
# Run script as root (higher privileges)
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit 1
else
@mansouryaacoubi
mansouryaacoubi / gelocation-disable-workaround-orig.js
Last active April 23, 2018 07:08
GeoLocation Prompt Deactivation/Disable
function disableLocationRequest() {
var workaroundFunc = function(successCallback=null, errorCallback=null, options=null) {
console.warn('User Location Request disabled');
};
// Backup native code
navigator.geolocation.old_getCurrentPosition = navigator.geolocation.getCurrentPosition;
navigator.geolocation.old_watchPosition = navigator.geolocation.watchPosition;
// Disable original behaviour
navigator.geolocation.getCurrentPosition = workaroundFunc;
navigator.geolocation.watchPosition = workaroundFunc;
@mansouryaacoubi
mansouryaacoubi / occurrences.js
Created February 22, 2018 15:58
Find amount of occurrences of value in array (Javascript)
Array.prototype.occurrences = function(val) {
var i = 0, c = 0;
while( (i = this.indexOf(val,i)+1) && ++c );
return c;
};
@mansouryaacoubi
mansouryaacoubi / fczgh.md
Last active December 28, 2017 00:22
fzugvhibjokp
@mansouryaacoubi
mansouryaacoubi / InstallPackagesPython.md
Created December 27, 2017 23:55
Install Packages in Python with PIP and Installers
@mansouryaacoubi
mansouryaacoubi / fha_services.bat
Created December 15, 2017 09:55
Install Services for FH-Aachen
REM @autor Mansour Yaacoubi
REM @version 1.5.1
REM @description A batch processing file to setup
REM @changelog Bugfix for to early drive mount (Internet connection check),
REM added FH-Aachen BSCW Cloud Service, added functionality to re- and deinstall,
REM unmounts drives at deinstallation
@echo off
cd\
color 74