Skip to content

Instantly share code, notes, and snippets.

View Mehran's full-sized avatar
🎯
Focusing

Mehran Mehran

🎯
Focusing
View GitHub Profile
@Mehran
Mehran / com.user.loginscript
Last active November 17, 2017 19:20
Logon script for mac Seirra
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.loginscript</string>
<key>ProgramArguments</key>
<array><string>/Users/mehran/Pictures/Wallpapers/unsplash/login.sh</string></array>
<key>RunAtLoad</key>
<true/>
@Mehran
Mehran / wallpaper.sh
Last active May 4, 2018 14:24
Kali Linux Wallpaper changer
rm -f ~/Pictures/Wallpapers/unsplash/"$(date +%F)".png
curl -s -L -o ~/Pictures/Wallpapers/unsplash/"$(date +%F)".png "https://unsplash.it/2560/1600/?random" > /dev/null
gsettings set org.gnome.desktop.background picture-uri file:///root/Pictures/Wallpapers/unsplash/"$(date +%F)".png
echo "deb http://http.kali.org/kali kali-rolling main contrib non-free" >> /etc/apt/sources.list
apt-get install kali-archive-keyring -y
apt-get update
apt-get upgrade -y --allow-unauthenticated
apt-get install kali-linux
@Mehran
Mehran / kali-wallpaperchanger.sh
Last active December 11, 2017 08:01
Change kali rolling Walpaper Command line
#!/bin/bash
mkdir -p ~/Pictures/Wallpapers/unsplash
rm -f ~/Pictures/Wallpapers/unsplash/*.png
curl -s -L -o ~/Pictures/Wallpapers/unsplash/"$(date +%F)".png "https://unsplash.it/2560/1600/?random" > /dev/null
gsettings set org.gnome.desktop.background picture-uri file:///root/Pictures/Wallpapers/unsplash/"$(date +%F)".png
@Mehran
Mehran / sshtelegram.sh
Last active May 31, 2019 17:27
Bot that posts SSH logins to Telegram
#!/bin/bash
KEY="<your bot token>"
URL="https://api.telegram.org/bot$KEY/sendMessage"
TARGET="<your chat ID>" # Telegram ID of the conversation with the bot, get it from /getUpdates API
TEXT="User *$PAM_USER* logged in on *$HOSTNAME* at $(date '+%Y-%m-%d %H:%M:%S %Z')
Remote host: $PAM_RHOST
@Mehran
Mehran / fstab
Created May 13, 2018 04:33
fstab
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 0
/dev/mmcblk0p2 / ext4 defaults,noatime,nodiratime 0 0
/var/swapfile none swap sw 0 0
@Mehran
Mehran / resizeme.sh
Last active May 13, 2018 04:55
Automation script to resize Diskspace for Kali Linux 2018.2 in RaspberryPi 3
#!/bin/sh
# Automation resize remaining diskspace for Kali Linux 2018.2 on Rapsberry Pi3
# Get the starting offset of the root partition
PART_START=$(parted /dev/mmcblk0 -ms unit s p | grep "^2" | cut -f 2 -d:)
[ "$PART_START" ] || return 1
# Return value will likely be error for fdisk as it fails to reload the
# partition table because the root fs is mounted
fdisk -uc /dev/mmcblk0 <<EOF
@Mehran
Mehran / instapy-easy.sh
Last active December 18, 2018 13:54
instapy-easy.sh
#!/bin/bash
### Author ###
# By : Mehran Goudarzi
# Update : 2018-11-12
# Description : Automation Installer (Ubuntu 18.0 & Ubuntu 16.0)
# Version : 1.2
###############
echo -e "[*] General dependencies..."
apt-get update
apt-get -y upgrade
@Mehran
Mehran / ikev2.sh
Created July 14, 2018 04:51
IKEV2 Automation
#!/bin/bash
### Author ###
# By : Mehran Goudarzi
# Release : 2018-06-24
# Description : IKEV2 Auto Creator
# Version : 1.1
###############
### Colors ####
BRed="\033[1;31m"
BGreen="\033[1;32m"
@Mehran
Mehran / git-update.sh
Last active August 9, 2018 06:20
Automatic Gist update
#!/bin/bash
### Author ###
# By : Mehran Goudarzi
# Release : 2018-04-07
# Description : Git auto update for repository
# Version : 1.2
###############
### Colors ####