This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# display other devices on local network | |
sudo nmap -sn router_ip/24 | |
arp -a | |
# list usb devices | |
lsusb | |
# disk space usage (human readable) | |
df -h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
control + F11 -> show desktop | |
hold control + click desktop -> update widgets | |
command + space -> show spotlight to type a program | |
//show hidden files in Mac | |
defaults write com.apple.Finder AppleShowAllFiles true | |
killall Finder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import secrets | |
import string | |
letters = string.ascii_letters | |
digits = string.digits | |
special_chars = string.punctuation | |
alphabet = letters + digits + special_chars | |
pwd_length = 16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
gifsicle --colors 256 --merge *.gif -o game2.gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Pretty and comprehensive git log | |
# see https://git-scm.com/docs/git-log#_commit_formatting for options | |
git log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%an%C(reset)%C(bold yellow)%d%C(reset) %C(dim white)- %s%C(reset)' --all | |
#display stats about a commit | |
# see https://git-scm.com/docs/git-show | |
git show b1e7dcb0204d1eab337d0ff7b41a3e53441ed2bc --stat | |
#show changes for a file | |
git show <commit> -- <filepath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adb shell settings put global window_animation_scale 0.0 | |
adb shell settings put global transition_animation_scale 0.0 | |
adb shell settings put global animator_duration_scale 0.0 | |
# keyboard | |
adb shell settings put secure show_ime_with_hard_keyboard 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script is identical to the one provided by the course Udacity Cybersecurity Nanodegree except I commented out some lines | |
# so it can be run in the cloud Shell | |
# Objective: use azure cloud shell to create Joe's Garage PC for the project | |
$transcriptFileName = ("{0}\{1}.txt" -f $env:TEMP, ([datetime]::Now.ToString("yy.MM.dd_hh.mm.ss"))) | |
$resourceLocation = "East US2" | |
$udacityLabAgentAppName = "Udacity CYBERND01 Student VM Agent" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script is identical to the one provided by the course Udacity Cybersecurity Nanodegree except I commented out some lines | |
# so it can be run in the cloud Shell | |
$transcriptFileName = ("{0}\{1}.txt" -f $env:TEMP, ([datetime]::Now.ToString("yy.MM.dd_hh.mm.ss"))) | |
$resourceLocation = "East US2" | |
$udacityLabAgentAppName = "Udacity CYBERND01 Student VM Agent" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
[[ -n "${APP_SLUG}" ]] || { echo "APP_SLUG env var needs to be set"; exit 1; } | |
[[ -n "${ACCESS_TOKEN}" ]] || { echo "ACCESS_TOKEN env var needs to be set"; exit 1; } | |
INSTANCE="akvoflow-uat1" | |
curl -X POST -H "Authorization: ${ACCESS_TOKEN}" "https://api.bitrise.io/v0.1/apps/${APP_SLUG}/builds" -d \ | |
'{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# fail if any commands fails | |
set -e | |
# debug log | |
set -x | |
VERSION="$(cat app/version.properties | grep -o "VERSION_CODE=\+[0-9]\+" | cut -c 14-)" | |
VERSION_NEW=$((VERSION+1)) | |
echo $VERSION_NEW | |
sed -i "s/\(VERSION_CODE=\).*\$/\1${VERSION_NEW}/" app/version.properties |
NewerOlder