App-Cheats

 view release on metacpan or  search on metacpan

cheats.txt  view on Meta::CPAN

#############################################################
## Linux Commands - zero
#############################################################

# Clear NVM/flash memory (from start to and including the end address)
zero -p ppa -s 0xSTART_ADDRESS -e 0xEND_ADDRESS


#############################################################
## Linux Accounts
#############################################################

# Check when a users account was created (good unless file was updated or touched)
ll ~SOME_USER/.bash_logout

# Check when a users account was created (good unless home account changed)
ll -d ~SOME_USER
echo ~SOME_USER | perl -lne 'print for -M,-C,-A'


#############################################################
## Linux Hardware
#############################################################

# View how many processors are on a machine/bench
cat proc/cpuinfo
cat /proc/cpuinfo | perl -ln0777e "print ~~split qq(\n\n)"
nproc

# Find out the service tag code of a machine (Bob)
# That is the same as the serial number
# Used for compability purposes (such as when getting new drives)
/usr/sbin/dmidecode | perl -ln00e 'print if /System Information/'

# Find out easily how many cpu there are (a command)
lscpu

# Check if using intel or AMD. (linux)
lscpu | grep 'Vendor ID'

# Add module to kernel (DES,UI,insert,library)
insmod /lib/modules/2.6.11/kernel/fs/fat/fat.ko
modprobe msdos

# Find out version of debian you are running (DES)
cat /etc/debian_version

# Check processor family (DES,UI)
grep "cpu family" /proc/cpuinfo
# Cpu family of "6" means use "Pentium-Pro"

# Change boot loader to use certain cpu's (DES,UI,Mark,shielding)
cd /boot/grub
sudo vi grub.cfg
/\Vlinux /boot/vmlinuz-3.16.51+20180205+1524
/\Vlinux /boot/vmlinuz-3.16.51+20180205+1524
# Add this to
isolcpus=0,1,2,3,4,5,6,7,8,9
cat /proc/cmdline

# Check timer frequency (DES,UI,CONFIG_HZ_1000)
cat /usr/src/linux.config | OR CONFIG_COMPAT_BRK CONFIG_HZ_PERIODIC CONFIG_X86_GENERIC CONFIG_SCHED_SMT CONFIG_HZ_1000

# find biggest binary number on the machine
perl -lE '@a=split //, sprintf "%b",  ~~-1; print @a'
perl -lE '@a=split //, sprintf "%b",  ~~-1; print scalar @a'

# Size of an integer on this system
perl -le 'print length pack "i"'


#############################################################
## Linux File Properties - General
#############################################################

# View more info about a file (Bash)
# Number of links, inode
stat $FILE

# Check inode of a file.
ls -i FILE

# Find all hardlinks to a file.
find . -samefile FILE
find . -inum INODE

# Print all the symbolic links in a directory and show where they link to (for Melvin)
ls | perl -lne '$r=readlink; print "$_ -> $r" if -l'

# Check if a file is opened (Added: 2017-11-20 02:48:53 PM)
lsof | grep my_file

# Check if vi has open (Added: 2017-11-20 02:49:11 PM)
lsof -c vi

# Check/Detect a symbolic link
[ -L "link_file" ] && echo "A"


#############################################################
## 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

cheats.txt  view on Meta::CPAN

readlink -f file
readlink -e file
readlink -m file


#############################################################
## Bash - Pipeline
#############################################################

# Redirect STDERR to STDOUT (pipe,bash)
2>&1
|&

# Redirect both STDOUT and STDERR to a pipe
2>&1 | tee out

# Swap STDERR with STDOUT
showpath | xargs ls -ld 3>&2 2>&1 1>&3

# Redirect STDERR to STDOUT
showpath | xargs ls -ld 2>&1 1>/dev/null

# Show only STDERR (redirect STDOUT)
ld_dsu.prl sre csv |1
ld_dsu.prl sre csv 1>/dev/null

# Send message to STDERR
say(){ echo "GOOD"; echo "BAD" >&2; }
say 2>/dev/null         # GOOD
say  >/dev/null         # BAD
say >> log 2>&1
say 2>&1 >> log


#############################################################
## Bash Signal Handling
#############################################################

# Use trap command to trap signals
trap arg signals

# Remove signal handling
trap signal

# Create an infinite loop (no end)
while true; do echo "$$ $BASHPID"; sleep 1; done

# See all available trap signals
trap -l

# Prevent control-C from doing anything (signal)
abc(){ echo -e "\n\nNOPE"; }
trap abc SIGINT
<Control-C>

# Prompt on a control-C (signal handling)
signal_handler(){ echo -e "\n${RED}Caught Control-C$RESTORE "; read -p "Are you sure you want to abort? (y/n): " ans; [[ $ans =~ [yY]  ]] && echo "continue" || echo "exit"; }
trap signal_handler SIGINT
<Control-C>

# Create a timer in bash (aborts the session)
handler(){ echo "done"; exit 1; }
set_timer(){ (sleep $1; kill -ALRM $$)& }
trap handler SIGALRM
set_timer 5
while [ 1 ]; do echo $$; sleep 1; done

# Trap alarm signal
trap 'echo "Hit alarm"; break' SIGALRM
while true; do echo $$; sleep 1; done
# In another window:
kill -s ALRM 11657

# List of Bash signals and meanings.
Signal      Standard   Action   Comment
------------------------------------------------------------------------
SIGABRT      P1990      Core    Abort signal from abort(3)
SIGALRM      P1990      Term    Timer signal from alarm(2)
SIGBUS       P2001      Core    Bus error (bad memory access)
SIGCHLD      P1990      Ign     Child stopped or terminated
SIGCLD         -        Ign     A synonym for SIGCHLD
SIGCONT      P1990      Cont    Continue if stopped
SIGEMT         -        Term    Emulator trap
SIGFPE       P1990      Core    Floating-point exception
SIGHUP       P1990      Term    Hangup detected on controlling terminal
                                or death of controlling process
SIGILL       P1990      Core    Illegal Instruction
SIGINFO        -                A synonym for SIGPWR
SIGINT       P1990      Term    Interrupt from keyboard
SIGIO          -        Term    I/O now possible (4.2BSD)
SIGIOT         -        Core    IOT trap. A synonym for SIGABRT
SIGKILL      P1990      Term    Kill signal
SIGLOST        -        Term    File lock lost (unused)
SIGPIPE      P1990      Term    Broken pipe: write to pipe with no
                                readers; see pipe(7)
SIGPOLL      P2001      Term    Pollable event (Sys V);
                                synonym for SIGIO
SIGPROF      P2001      Term    Profiling timer expired
SIGPWR         -        Term    Power failure (System V)
SIGQUIT      P1990      Core    Quit from keyboard
SIGSEGV      P1990      Core    Invalid memory reference
SIGSTKFLT      -        Term    Stack fault on coprocessor (unused)
SIGSTOP      P1990      Stop    Stop process
SIGTSTP      P1990      Stop    Stop typed at terminal
SIGSYS       P2001      Core    Bad system call (SVr4);
                                see also seccomp(2)
SIGTERM      P1990      Term    Termination signal
SIGTRAP      P2001      Core    Trace/breakpoint trap
SIGTTIN      P1990      Stop    Terminal input for background process
SIGTTOU      P1990      Stop    Terminal output for background process
SIGUNUSED      -        Core    Synonymous with SIGSYS
SIGURG       P2001      Ign     Urgent condition on socket (4.2BSD)
SIGUSR1      P1990      Term    User-defined signal 1
SIGUSR2      P1990      Term    User-defined signal 2
SIGVTALRM    P2001      Term    Virtual alarm clock (4.2BSD)
SIGXCPU      P2001      Core    CPU time limit exceeded (4.2BSD);
                                see setrlimit(2)
SIGXFSZ      P2001      Core    File size limit exceeded (4.2BSD);
                                see setrlimit(2)
SIGWINCH       -        Ign     Window resize signal (4.3BSD, Sun)


#############################################################
## Bash - Variables (Special)
#############################################################

# Return status $? (true/false are built-in commands)
true; echo $?
false; echo $?

# Note however that local var=$(command) will (bash)
NOT return the exit code. Instead you need to do
local var;
var=$(command)

# In bash, setting a variable in a subshell
# does not affect the outer shell.
v=1; echo $v; (echo $v; v=2; echo $v; ); echo $v
1
1
2
1
#
# An approach around this is to set the variable
# inside the function.
fun(){ echo $v; v=2; echo $v; }; v=1; echo $v; fun; echo $v

# In bash return 0 means no error. return 1 means error
abc(){ return 0; }; abc && echo "OK" || echo "BAD"
abc(){ return 1; }; abc && echo "OK" || echo "BAD"

# Check if using Bash
echo $0


#############################################################
## Bash - Variables (User)
#############################################################

cheats.txt  view on Meta::CPAN

            .then(show)
            .then(check)
            .then( (done) => { end(done,main_loop) } )
            ;
    };
//
    main_loop();
}

# Making statements run in order (JQuery,Deferred,Promises)
# A list/array of promises.
function test_add_tooltypes() {
    const promise = [];
    for(...){
        const p = ajax_post_add(...);
        promise.push(p);

    }
    return promise;
}
#
# Usage (... literal here to spread the list)
$.when(...test_add_tooltypes()).then(function(){ console.log("DONE") })

# Basics of using Deferred and Promise (JQuery,Deferred,Promises)
#
# A promise can only be checked like:
.done()
.fail()

# Basics of using Deferred and Promise (JQuery,Deferred,Promises)
#
# $.ajax returns a Promise-compatible object (jqHXR).
const promise = $.ajax(...);

# Basics of using Deferred and Promise (JQuery,Deferred,Promises)
#
# Can run a callback on success or failure this way:
$.ajax({success: cb1, error: cb2});
$.ajax(...)
	.done(cb1)
	.fail(cb2);

# Basics of using Deferred and Promise (JQuery,Deferred,Promises)
#
# Can wait for multiple async calls to finish like this:
$.when($.ajax(...), $.ajax(...))
	.done(cb1)
	.fail(cb2);

# Basics of using Deferred and Promise (JQuery,Deferred,Promises)
#
# Can check the progress of a deferred using notifications.
var deferred = $.Deferred().progress(function (value) {
   $('.progress').text(value + '%');
});
#
# Then send the notification:
deferred.notify(value);

# Promise based timer (JQuery,Deferred,Promises)
function timeout(milliseconds) {
	var deferred = $.Deferred();
	setTimeout(deferred.resolve, milliseconds);
	return deferred.promise();
}
timeout(1000).done(function() {
	alert('I waited for 1 second!');
});

# Wait for animations to finish (JQuery,Deferred,Promises)
$('.animation').promise().then(callback);

# Wait for an element to load before running a function (JQuery,Ajax)
$('#details').ready(unhide_details);


#############################################################
## JQuery Selectors - Simple CSS Selectors. Table 2.1
#############################################################

# Matches all anchor (a) elements (JQuery,Selectors,CSS,Simple,Table 2.1)
a

# Matches all anchor (a) elements that have the class special-class
# (JQuery,Selectors,CSS,Simple,Table 2.1)
a.special-class

# Matches all elements with the class class and class special-class
# (JQuery,Selectors,CSS,Simple,Table 2.1)
.class.special-class


#############################################################
## JQuery Selectors - CSS Hierarchy. Table 2.2
#############################################################

# Matches all elements with tag name F that are descendants of E
# (JQuery,Selectors,CSS,Hierarchy,Table 2.2)
E F

# Matches all elements with tag name F that are direct children of E
# (JQuery,Selectors,CSS,Hierarchy,Table 2.2)
E>F

# Matches all elements with tag name F that are immediately preceded by
# sibling E (JQuery,Selectors,CSS,Hierarchy,Table 2.2)
E+F

# Matches all elements with tag name F preceded by any sibling E
ä (JQuery,Selectors,CSS,Hierarchy,Table 2.2)
E~F


#############################################################
## JQuery Selectors - Attribute Selectors. Table 2.3
#############################################################

# Matches all elements with tag name E that have attribute A of any value
# (JQuery,Selectors,Attribute,Table 2.3)
E[A]

cheats.txt  view on Meta::CPAN

-0777 - slurp mode
#
# $/
undef - slurp mode
blank - paragraph mode
\256  - fixed byte mode


#############################################################
## Perl Variables - *STDOUT
#############################################################

# Redirect STDOUT to a variable in perl
perl -E "{local *STDOUT; open STDOUT, '>', \$v or die $!; say 123;} say qq([$v])"

# Use -t to test STDIN and STDOUT:
sub I_am_interactive {
    return -t STDIN && -t STDOUT;
}


#############################################################
## Perl Variables - $^T
#############################################################

# Find out when a program was started (timestamp)
perldoc -v "$^T"
>    $BASETIME
>    $^T     The time at which the program began running, in seconds since
>            the epoch (beginning of 1970). The values returned by the -M,
>            -A, and -C filetests are based on this value.
perl -MEnglish -le "print $BASETIME"		# 1605178952
perl -le "print $^T"


#############################################################
## Perl Modules - General
#############################################################

# General, interesting trick in perl.
# Given:
My.pm:
    package My;
    print "In My.pm\n";
My.pmc:
    package My;
    print "In My.pmc\n";
#
# pmc has precedence:
perl -MMy -e0
In My.pmc


#############################################################
## Perl Modules - AnyEvent
#############################################################

# Simple exmplae of parallel processing
# (Perl Modules - AnyEvent)
# NOT WORKING!
perl -MAnyEvent -E 'my @files = (1..30); my $cv = AnyEvent->condvar; foreach my $file (@files) { $cv->begin; AnyEvent->timer(after => 0, cb => sub { say "Processing file $file"; sleep(1); $cv->end; }); } $cv->recv;'


#############################################################
## Perl Modules - Automake::Config
#############################################################

# Install Automake::Config (termux)
git clone git@github.com:poti1/arm-none-eabi.git
cd arm-none-eabi
cpanm --look automake-1.15.gz
$ ./configure
$ make
$ make install


#############################################################
## Perl Modules - autovivification
#############################################################

# autovivification Example:
perl -Me -E 'my $h = { k => 11  }; no autovivification; say defined $h->{k2}{k3}{k5}; p $h'
{
    k   11
}


#############################################################
## Perl Modules - B::Concise
#############################################################

# Perl Modules - B::Concise
# explain what a perl program is doing (very concise).
perl -MO=Concise -e 'print 111'


#############################################################
## Perl Modules - B::Deparse
#############################################################

# Perl Modules - B::Deparse
# explain what a perl program is doing (simply)
perl -MO=Deparse -e 'print 111'


#############################################################
## Perl Modules - bignum
#############################################################

# Convert big numbers into full form
# from scientific notation to expanded form
echo "$b" | perl -Mbignum -lpe '$_ += 0'


#############################################################
## Perl Modules - binmode
#############################################################

# Using unicode in perl STDOUT
perl -CO   script
perl -C    script # Which is same as

cheats.txt  view on Meta::CPAN

   use Mojo::Base qw/ -strict -signatures /;
   use Mojo::JSON qw(j);
   use Encode qw/ encode /;
   sub spurt_json ( $self, $struct ) {
      my $string       = j $struct;
      my $_pretty_json = qx(echo '$string' | jq .);
      my $pretty_json  = encode( "UTF-8", $_pretty_json );
      $self->spurt( $pretty_json );
   }
}

# Find a path given a class name.
# Alternative to "perldoc -l class".
perl -MMojo::File=path -MMojo::Util=class_to_path -E '$p = class_to_path "Mojo::UserAgent"; for ( @INC ) { $p2 = path($_,$p); if(-e $p2){ say $p2; lat } }'


#############################################################
## Perl Modules - Mojo::IOLoop
#############################################################

# Run Something every few seconds.
perl -Mojo -E 'my $ioloop = a->ua->ioloop; my $n; $ioloop->recurring(2 => sub{  say "hey"; $ioloop->stop if $n++ > 2 } ); $ioloop->start'


#############################################################
## Perl Modules - Mojo::MemoryMap
#############################################################

# Share data/structures between processes.
perl -Mojo -MMojo::MemoryMap -E 'my $map = Mojo::MemoryMap->new; my $w = $map->writer; say r $w->fetch; $w->change(sub{ $_->{abc} = 123 }); say r $w->fetch'
{}
{
  "abc" => 123
}


#############################################################
## Perl Modules - Mojo::Parameters
#############################################################

# Access the contents of an array like a hash by key.
perl -MMojo::Util=dumper -E '@a=qw/a 1 b 2 c 3/; %h=@a; say dumper \%h'
#
# This might be more efficient for bigger lists.
perl -MMojo::Parameters -MMojo::Util=dumper -E '@a=qw/a 1 b 2 c 3/; $params = Mojo::Parameters->new(@a); say dumper $params->param("b")'
perl -MMojo::Parameters -MMojo::Util=dumper -E '@a=qw/a 1 b 2 c 3/; $params = Mojo::Parameters->new(@a); say dumper $params->every_param("b")'


#############################################################
## Perl Modules - Mojo::Promise
#############################################################

# Promise usage
perl -Mojo -E "my $p = Mojo::Promise->new; $p->then(sub($robot,$human){ say qq(robot: $robot); say qq(human: $human); }, sub{ say qq!Rejected with: @_!} )->catch( sub{say qq!Error: @_!} ); $p->resolve(qw/Bender Fry Leela/); $p->wait"

# Simple Mojo promise example
perl -MMojo::Promise -E '$p = Mojo::Promise->new; $p->then(sub{say "OK"}); $p->resolve; $p->wait'
perl -MMojo::Promise -E '$p = Mojo::Promise->new; $p->then(sub{say "OK"}, sub{say "BAD"}); $p->resolve; $p->wait'
perl -MMojo::Promise -E '$p = Mojo::Promise->new; $p->then(sub{say "OK"}, sub{say "BAD"}); $p->reject; $p->wait'

# Simple Mojo promise example - timer (OK)/ timeout (BAD)
perl -MMojo::Promise -E "$p = Mojo::Promise->new; $p->then(sub{say 'OK'}, sub{say 'BAD'}); $p->timeout(1); $p->wait"
perl -MMojo::Promise -E "$p = Mojo::Promise->new; $p->then(sub{say 'OK'}, sub{say 'BAD'}); $p->timer(1); $p->wait"

# Chain of promises - short way, but not working for the 2nd level
perl -Mojo -MMojo::Promise -E "my $p = Mojo::Promise->new; $p->then(sub{say '1-OK'}, sub{say '1-BAD'})->then(sub{say '2-OK'}, sub{say '2-BAD'}); $p->reject; $p->wait"

# Chain of promises - long way
perl -Mojo -MMojo::Promise -E "my $p = Mojo::Promise->new; my $p2; $p2 = $p->then(sub{say '1-OK'; $p2->resolve}, sub{say '1-BAD'; $p2->reject}); $p2->then(sub{say '2-OK'}, sub{say '2-BAD'}); $p->reject; $p->wait"

# Using get_p (GET with a promise)
perl -Mojo -MMojo::Promise -E "my $ua = Mojo::UserAgent->new; $ua->get_p(shift)->then(sub{say qq(1-OK: @_)}, sub{say qq(1-BAD: @_)})->wait" mojolicious.org

# Create a list of promises and a top promise to watch them all
perl -MMojo::Promise -E "@p = map { my $p = Mojo::Promise->new; my $n = $_; $p->then(sub{say $n ** 2}, sub{ warn qq(Error in $n\n)}); $p } 1..10; $tp = Mojo::Promise->all(@p)->then(sub{say 'OK'}, sub{say 'NOK'}); $_->resolve for @p; $tp->wait"
#
# Reject a promise
perl -MMojo::Promise -E "@p = map { my $p = Mojo::Promise->new; my $n = $_; $p->then(sub{say $n ** 2}, sub{ warn qq(Error in $n\n)}); $p } 0..10; $tp = Mojo::Promise->all(@p)->then(sub{say 'OK'}, sub{say 'NOK'}); $p[4]->reject; $tp->wait"
#
# Try rejecting/approving
perl -Mojo -MMojo::Promise -E "my @p = map {my $n = $_; my $p = Mojo::Promise->new; $p->then(sub{say qq(P-OK: $n)}, sub{say qq(P-BAD: $n) }); $p } 0..2; my $hop = Mojo::Promise->all(@p)->then(sub{say 'OK'}, sub{say 'BAD'}); $p[$_]->reject for 0,1,2; ...

# Mojo promise race - first one wins
perl -MMojo::Promise -E "@p = map { my $p = Mojo::Promise->new; my $n = $_; $p->then(sub{say $n ** 2}, sub{ warn qq(Error in $n\n)}); $p } 0..10; $race = Mojo::Promise->race(@p)->then(sub{say 'OK'}, sub{say 'NOK'}); $_->resolve for $p[4], @p; $race->...

# HigherOrder Promises
perl -Mojo -MMojo::Promise -E "my @p = map {Mojo::Promise->new} 1..3; my $hop = Mojo::Promise->new; $hop->all(@p)->then(sub{say qq(OK: @_)}, sub{say qq(BAD: @_)}); $hop->wait"
#
# Mojo::Promise::Role::HigherOrder - Not working
perl -MMojo::Promise -E "my @p = map {Mojo::Promise->new} 0..2; my $hop = Mojo::Promise->with_roles('+Any')->any(@p)->then(sub{say 'OK'}, sub{say 'BAD'}); $p[$_]->reject for 0,1,2; $_->resolve for @p; $hop->wait"
perl -MMojo::Promise -E "my @p = map {my $n = $_; my $p = Mojo::Promise->new; $p->then(sub{say qq(\nP-OK$n)}, sub{say qq(\nP-BAD$n) }); $p } 0..2; my $hop = Mojo::Promise->with_roles('+Any')->any(@p)->then(sub{say 'OK'}, sub{say qq(\nBAD)}); $p[$_]->...

# Check if a[href] urls in html files are accessbile
for file in *.xhtml; do echo; echo $file; my_get_ok $(perl -Mojo -E 'my $dom = x f(shift)->slurp; say for $dom->find("a[href]")->map("attr", "href")->each' "$file" | not -r '^\w+\.\w+$' | sort -u); done
my_html_links_check *.xhtml


#############################################################
## Perl Modules - Mojo::UserAgent
#############################################################

# Download a PDF file using Perl
perl -Mojo -E "my $ua = Mojo::UserAgent->new; my $url = Mojo::URL->new('https://hop.perl.plover.com/book/pdf/HigherOrderPerl.pdf'); my $f = $url->path->parts->[-1]; my $tx = $ua->get($url)->result->save_to($f)"

# Download a PDF file using Perl
# Will not download if it is already up to date. (by date)
perl -Mojo -E "my $ua = Mojo::UserAgent->new; my $url = Mojo::URL->new('https://hop.perl.plover.com/book/pdf/HigherOrderPerl.pdf'); my $f = $url->path->parts->[-1]; my $t = (stat($f))[9]; my $d = Mojo::Date->new($t); my $tx = $ua->get($url, {'If-Modi...

# Create a Mojo Websocket and message hooks
perl -Mojo -E "my $ua = Mojo::UserAgent->new; say r $ua->websocket_p('ws://172.17.17.1:80/get_jobs')->then(sub($tx){ my $p = Mojo::Promise->new; $tx->on(finish => sub($tx,$code,$reason){ say qq(Closed with code $code); $p->resolve;}); $tx->on(message...

# Show all the redirects
perl -Mojo -E "my @txs = Mojo::UserAgent->new->max_redirects(10)->head(shift); while(my $tx = $txs[0]->previous){ unshift @txs, $tx } say $_->req->url for @txs" mojolicious.org
perl -Mojo -E "my $tx = Mojo::UserAgent->new->max_redirects(10)->head(shift); say $_->req->url for $tx->redirects->@*, $tx" mojolicious.org


#############################################################
## Perl Modules - Mojo::Util
#############################################################

# steady_time and promises
perl -Mojo -MMojo::Util=steady_time -E "sub st($m){printf qq(%-20s: %s\n), steady_time, $m} st('Before'); my $ua = Mojo::UserAgent->new; for my $url(@ARGV){ st(qq(Trying: $url)); state $cnt = 0; my $label = $cnt++; $ua->get($url => sub{ st(qq(Finishe...

cheats.txt  view on Meta::CPAN

    Right-Click on or inside apktool.yml file ➜ APKLab: Rebuild the APK


#############################################################
## VPN
#############################################################

# Open VPN file storage location on Ubuntu:
/etc/NetworkManager/system-connections/
# For android, change '=' to ' '

# Manually run openvpn.
cd ~/my/git/otrs/SETUP/vpn_setup/EasyRSA/pki/private
sudo openvpn --config vpn-otrs.conf


#############################################################
## VLC
#############################################################

# Install support for creating soft subtitles in vlc videos (mp4)
sudo apt install gnome-subtitles
rm -fr ~/.cache/gstreamer-1.0/*     # If error opennig file.
gnome-subtitles


#############################################################
## Vue - General
#############################################################

# Vue shorthand (shortcuts)
@click = v-on:click
:value = v-bind:value

# Check Vue version
npm v vue

# Create Vue CLI app
vue create vue-first-app

# Run Vue server (start)
cd vue-first-app
npm run serve
#
# The npm run commands can be found in:
package.json /"scripts":
#
# Defaut script commands:
serve
build
lint

# Missing Node modules folder
npm install

# Setup vue webpack (many files)
npm install --global vue-cli
vue init webpack

# Vue - Watch for changes to this.$refs
this.$watch(() => this.timerRef ? this.timerRef.timer.time : null, (newTime, oldTime) => {
    console.log('Watched time: ', newTime, oldTime);
    this.$refs.form.values.AccountedTime = newTime;
});


#############################################################
## WII
#############################################################

# Write files/games to WII.
https://mariokartwii.com/showthread.php?tid=121
https://www.gametdb.com/Wii/Search


#############################################################
## Windows Bugs
#############################################################

# Windows stuck in control mode (Tobias Wulf,windows bug)
Recovery: Most of the time, Ctrl + Alt + Del re-sets key status
to normal if this is happening. (Then press Esc to exit system screen.)
Another method: You can also press stuck key: so if you clearly see that
it is Ctrl which got stuck, press and release both left and right Ctrl .

# Why I have to press keys two times to get the ^ or ´ or ` (windows bug)
With this keyboard layout the ^ keystroke becomes a modifier to
enabling entering of special characters.
To get a single ^ character you will need to type ^+Space.


#############################################################
## Windows Command Prompt (DOS)
#############################################################

# Set an environmental variable (DOS)
setx <variable> <value>

# Unset an environmental variable (DOS)
setx <variable> ""

# Append path environmental variable (DOS)
setx path "new_dir_to_append"

# Change the width and height of a DOS window
mode con: cols=120 lines=20


#############################################################
## Windows - Drives
#############################################################

# Get mapped windows drives
net use

# Map windows drives
net use k: \\path /persistent:yes


#############################################################
## Windows - Excel



( run in 1.322 second using v1.01-cache-2.11-cpan-39bf76dae61 )