App-Cheats
view release on metacpan or search on metacpan
#############################################################
#############################################################
## ADB - OnePlus
#############################################################
# Connect to phone and fix file permissions. (oneplus)
adb shell
su
chmod 777 /data/data
#############################################################
## Android
#############################################################
# Copy android files over the network (like myPhoneExplorer)
sudo apt install syncthing
syncthing
# Launch "My Files" on Android.
#############################################################
# Add line numbers to a file
cat -n <file>
# Skip the first line on the file
cat file | tail -n +2
#############################################################
## Linux Commands - chmod
#############################################################
# Set suid for a file
sudo chmod +s file
# Change permission of only the group
chmod g+w file
#############################################################
## Linux Commands - chown
#############################################################
# Fix ownership of user directory
cd home_dir/user_dir
sudo chown -Rh ${PWD##*/} `ls -A`
# Find all files but do not look in certain directories
find $source -not \( -path '*.svn' -prune -or -path '*.git' -prune \) > $all_files
# Find specific files but return directories
find . -name "*.h" -printf '%h\n'
find . -name "*.h" -exec dirname {} ';'
find . -name "*.h" -exec dirname {} \;
# Change permissions of all files / folders.
find . -type f -exec chmod 664 {} ';'
find . -type d -exec chmod 775 {} ';'
# Using a variable to define the find string.
n="-name *.pm"; find . $n # Works.
n="-name '*.pm'"; find . $n # Looks correct, but does NOT work!
# Find all git directories from current location
find . -name .git -type d | xargs -I{} readlink -f {} | perl -ple 's#^/\w+##; s#/\.git$##'
# Find all files owned by a certain user
sudo find . -user xbe4092
# Show/See/Displays all configuration variables
getconf -a
#############################################################
## Linux Commands - grep
#############################################################
# Find what is setting the sticky bit to /tmp folder upon machine reboot
grep -r chmod /etc/* 2>/dev/null | NOT "chmod (?:0?(?:-[f]\s+)?\d{3}|[aguo]*[+-][rwxs]+)\b" '^Binary' | add_color chmod
grep -r '/tmp' /etc/* 2>/dev/null | NOT '^Binary' | add_color tmp
# Return matching file name only
grep --color "trace config off" * -l
# Return nonmatching file name only
grep --color "trace config off" * -L
# Find what is common in both files (difference)
fgrep -Ff a b
#############################################################
## Linux File Properties - Sticky Bit
#############################################################
# Show if sticky bit is set on temp directory
[ -k /tmp ] && echo t
# Set sticky bit
chmod +t /tmp
# Remove sticky bit
chmod -t /tmp
#############################################################
## Linux Firewall
#############################################################
# Add port to firewall
firewall-cmd --add-port=8081/tcp --permanent
firewall-cmd --reload
## Linux Swap Memory
#############################################################
# Create swap memory file
#
mkdir /media/fasthdd
dd if=/dev/zero of=/media/fasthdd/swapfile.img bs=512 count=1M
#
# Turn that swap file into a filesystem !?
mkswap /media/fasthdd/swapfile.img
chmod 600 /media/fasthdd/swapfile.img
#
# Add this line to /etc/fstab to be able to use the swap at startup
/media/fasthdd/swapfile.img swap swap sw 0 0
#
# Activate the swap file
swapon /media/fasthdd/swapfile.img
#
# Deactivate the swap file
swapoff /media/fasthdd/swapfile.img
perl -Iblib/lib -Iblib/arch -MExample2 -e 'Example2b::print_hello'
# Create a new distribution in perl.
module-starter --module=My::Test --distro=my-test --author="AUTHOR" --email="EMAIL" --mb --verbose
# Additional folder preparation (module-starter)
mv App-Pod/* .
rmdir App-Pod
mv ignore.txt .gitignore
echo "*.swp" >> .gitignore
chmod +x Build.PL
# Remove MYMETA.* and META.*
#
# Prepend to Build.PL
"#!/bin/env perl
"
# Additional folder preparation (module-starter)
# Add to Build.PL
meta_merge => {
resources => {
google-chrome --version
#
# Download same version:
# https://chromedriver.chromium.org/downloads
cd ~/Downloads
unzip chromedriver*.zip
#
# Move it:
sudo mv chromedriver /usr/bin/chromedriver
sudo chown root:root /usr/bin/chromedriver
sudo chmod +x /usr/bin/chromedriver
#
# Step 4 â Download Required Jar Files:
# Create selenium service
#
sudo cp ~/my/git/srto/selenium/setup/_etc_systemd_system_selenium.service /etc/systemd/system/selenium.service
sudo vi /etc/systemd/system/selenium.service
+ [Unit]
+ Description=Selenium Server
( run in 0.355 second using v1.01-cache-2.11-cpan-496ff517765 )