App-Cheats
view release on metacpan or search on metacpan
#############################################################
# Linux Terminal
#############################################################
# Search through linux terminal history
Control + r
#############################################################
## Linux Commands - apt-cache
#############################################################
# Search for available apt-get modules/libraries/package
apt-cache search perl
# View more info of packages to be installed
sudo apt-cache show perl
# Show module/library dependancies
apt-cache depends perl
#############################################################
## Linux Commands - apt-get
#############################################################
# Install a package
apt-get install perl
# Upgrade all packages
apt-get update
apt-get upgrade
# Remove a system package
sudo apt-get remove <package>
# Remove a system package along with its dependencies
sudo apt-get remove --auto-remove <package>
# Remove a system package along with its configuration
sudo apt-get purge <package>
# Remove a system package along with its dependencies and configuration
sudo apt-get purge --auto-remove <package>
# Add packages to apt-get install list
apt edit-sources # similar to: vi /etc/apt/sources.list
deb [trusted=yes] http://ftp2.de.debian.org/debian/ stable main contrib
apt-get update
# Apt update has many 404 errors.
# Fix with:
sudo apt dist-upgrade.
#############################################################
## Linux Commands - apt-key
#############################################################
# Add the key of a package site to allow installing from other sources
wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -
#############################################################
## Linux Commands - apt-list
#############################################################
# List trusted source lists for packages
sudo apt-key list
#############################################################
## Linux Commands - arp
#############################################################
# View all IP addresses (Debug,pi)
# Scan network
arp -a
netstat -a | findstr 172.17
# Remove arp -a cache (pi,debug)
netsh interface ip delete arpcache
#############################################################
## Linux Commands - awk
#############################################################
# Get the first line, second field (read file)
sui -u | grep "abc" | awk 'NR==1 {print $2}'
#############################################################
## Linux Commands - basename
#############################################################
# Get the basename or last file/directory of a string
basename <string>
#############################################################
## Linux Commands - cat
#############################################################
# 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
# Diff submodule
git diff --cached # wont show submodules unless inside the folder
git diff --cached --submodule
# Commit submodule changed
# Mode 16000 means "you're recoding a commit as a directory
# entry rather than a subdirecotry or file"
git ci -am "Added Submodules"
# Cloning project with submodules
# By default will get the submodule folder with no files
git clone <url> # Clone project
cd <submodule_folder>
git submodule init # Init local files
git submodule update # Get latest content of submodule
# Cloning project with submodules (simpler)
git clone --recursive <url>
# To remove a git submodule you need to:
# Delete the relevant section from the .gitmodules file.
# Stage the .gitmodules changes git add .gitmodules
# Delete the relevant section from .git/config.
# Run git rm --cached path_to_submodule (no trailing slash).
# Run rm -rf .git/modules/path_to_submodule (no trailing slash).
# Commit git commit -m "Removed submodule "
# Delete the now untracked submodule files rm -rf path_to_submodule
#############################################################
## Git - Extra Unused Commands
#############################################################
# Push upstream to origin (GitLab) and set upstream
git push -u origin master
# Pull down changes from origin
git pull origin master
# Need to restart explorer.exe after installing TortoiseGit
# before the icons will change.
#############################################################
## Gitlab - Syntax
#############################################################
# Multiple lines in command/script (Gitlab - Syntax)
https://docs.gitlab.com/ee/ci/yaml/script.html#split-long-commands
# Long lines can be split into multiple lines (no special syntax)
# "|" can be used to each line as a separate command.
# ">" can be used to each block of new line separated lines
as a separate command.
#############################################################
## GPG Encryption (PGP Key)
#############################################################
# Generate a PGP key
gpg --gen-key
# Create a PGP signed file
gpg -ea -r "YOUR_NAME" > $HOME/.pause
user USER
password Pas$word
# Show your PGP keys (list)
gpg -k # Public keys.
gpg -K # Secret keys.
# Decrypt a PGP signed file.
gpg -d ~/.pause
# Cache password in agent.
# Some reason this fixed caching.
gpgconf --kill gpg-agent
# Share GPG keys (export from one, import in another machine).
gpg --export-secret-key -a > secretkey.asc
gpg --import secretkey.asc
# Warning: It is NOT certain that the key belongs to the person named.
gpg --edit-ḱeys YOUR_NAME
trust
5
yes
# Delete expired keys.
#
# Step 1: Create revoke certificate:
gpg --output revoke.asc --gen-revoke YOUR_ID
#
# Step 2: Apply revoke:
gpg --import revoke.asc
#
# Step 3: Delete secret key:
gpg --delete-secret-keys YOUR_ID
#
# Step 4: Delete public key:
gpg --delete-keys YOUR_ID
# Delete all keys.
gpg --delete-key 'Tim Potapov'
gpg --delete-secret-key 'Tim Potapov'
#############################################################
## HTML Attribute - href
#############################################################
# Run a javascript function when clicking a link instead of going to a page
<a class="myWrapper" href="javascript:myFunc()"><div class="myText">+</div></a>
#############################################################
## HTML Element - details
#############################################################
# Create an automatically foldable element in HTML
<details>
<summary>Quick summary</summary>
<h1>All details start here</h1>
<p>and continue till the end</p>
</details>
#############################################################
## HTML Unicode
#############################################################
# HTML Unicode. ZERO WIDTH SPACE.
​ // e2808b
# Zero-width Unicode characters table:
ZERO WIDTH SPACE (U+200B)
Used to indicate word boundaries or add spacing without
affecting the layout visibly.
---
ZERO WIDTH NON-JOINER (U+200C)
Prevents ligatures or joinings between characters, commonly
used in scripts like Arabic and Persian.
---
ZERO WIDTH JOINER (U+200D)
Indicates that two characters should be joined together as
a single glyph.
---
LEFT-TO-RIGHT MARK (U+200E)
Indicates that text following it should be displayed left-
to-right, useful for mixing text with different
directionalities.
---
RIGHT-TO-LEFT MARK (U+200F)
Indicates that text following it should be displayed right-
to-left.
---
LEFT-TO-RIGHT EMBEDDING (U+202A)
Embeds text with a left-to-right directional override.
---
RIGHT-TO-LEFT EMBEDDING (U+202B)
Embeds text with a right-to-left directional override.
---
POP DIRECTIONAL FORMATTING (U+202C)
Resets the directionality to the surrounding context.
---
( run in 0.663 second using v1.01-cache-2.11-cpan-e1769b4cff6 )