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 / HowToInstallWin89.md
Last active June 8, 2017 08:03
Note to myself in case Win89 is not installing in VirtualBox

Installation

  • use ISO-image in VirtualBox, burn on Disc or flash on USB-drive
  • boot into image
  • if installation not possible because MS-DOS Startpartition is not available
  • fdisk > Y > 4 (List all partitions)
  • Delete all available partitions
  • Go back to menu
  • 1 > Y (Create new partition)
  • Windows 89 should be installing now
@mansouryaacoubi
mansouryaacoubi / batterylevel.bat
Last active June 12, 2017 10:06
Battery Level Retrieval from Windows Management Instrumentation Command-line for Notebooks
@echo off
REM @name MYBatteryLevel
REM @fullname Mansour Yaacoubi Battery Level Tool
REM @filename batterylevel.bat
REM @author Mansour Yaacoubi
REM @timestamp 04:09 PM June 7th, 2017
REM @country Germany
REM @description This batch-script retrieves the battery level from WMIC
REM This is the command that retrieves the battery level:
@mansouryaacoubi
mansouryaacoubi / GetProductKey.bat
Last active June 12, 2017 10:12
Get Windows Product Key via PowerShell, Registry and WMI
@echo off
powershell "Import-Module %~dp0GetProductKey.ps1; Get-WindowsKey"
@mansouryaacoubi
mansouryaacoubi / README.md
Last active June 12, 2017 12:36
Easy setup for Ubuntu background image

Simple Background Image Changer Script for Linux

This script uses gsettings to set the gnome.background of the current user.

setbg.sh vers. 1.5

You can use it as a standalone script to set the background image or you can even add this script to your .bash_aliases so that you can use the simple setbg-alias for the script.

setbg.sh vers. 2.3 [recommended]

You can use it as a standalone script to set the background image or you can even install this script

@mansouryaacoubi
mansouryaacoubi / HowToFindActiveDirectoryAddress.md
Last active June 21, 2017 23:59
How to find out Active Directory IP - LDAP AD

Start -> Run -> nslookup

set type=all

_ldap._tcp.dc._msdcs.yaacoubi.com

@mansouryaacoubi
mansouryaacoubi / sethostname.sh
Last active June 22, 2017 14:52
Easy script to set hostname in Linux
#!/bin/bash
# @discription Installation script for lamp
# @author Mansour Yaacoubi
# @filename sethostname.sh
# @todos add better documentation, add support for other distributions
curhostname=$(hostname)
newhostname=$1
################# CHECK WHETHER SCRIPT IS RUNNING AS ROOT #################
# Run script as root to be able to install software like
@mansouryaacoubi
mansouryaacoubi / install-lamp.sh
Last active June 22, 2017 20:42
Install LAMP on Linux Systems (Apache, MySQL, PHP)
#!/bin/bash
# @discription Installation script for lamp
# @author Mansour Yaacoubi
# @filename install-lamp.sh
# @todos add better documentation, add support for other distributions,
# create light-version of this tool
#
# Copyright 2017 myblog
#
# Licensed under the Apache License, Version 2.0 (the "License");
@mansouryaacoubi
mansouryaacoubi / HowToManageUsersInLinux.md
Last active June 23, 2017 10:34
Some notes for easy user management on Linux

How To Manage Users In Linux

Enable root account

sudo passwd

Disable root account

sudo passwd -l root

Add a new user

adduser

@mansouryaacoubi
mansouryaacoubi / diskpart-batch.txt
Created June 26, 2017 13:51
Diskpart clean disk and create new partitions
LIST DISK
SELECT DISK 1
CLEAN
CLEAN
CREATE PART PRI
SELECT PART 1
ACTIVE
ASSIGN
FORMAT FS=NTFS QUICK
EXIT
@mansouryaacoubi
mansouryaacoubi / SublimeText3ContextMenuAdd.bat
Last active July 3, 2017 00:51
Add a Context Menu Item for Sublime Text 3 to your Windows Context Menu (Open File and Folders)
@echo off
net session >nul 2>&1
IF ERRORLEVEL 1 GOTO ERROR
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
REM add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f