App-Cheats

 view release on metacpan or  search on metacpan

cheats.txt  view on Meta::CPAN

   for(i=0; i<argc; i++){
      printf("argv[%d]: %s\n", argc, argv[i]);
   }
   return(0);
}

# Get ascii and characters in c code (DES)
printf("d:%d c:%c\n", 'A', 'A');

# Rename the oms trace files
ls -1 | perl -lpe '$o=$_; s/_[c0][a-z0-9]*_\d+//; rename $o => $_'

# Call C++/CPP function from C Step 1(OMS)
# Put code inside:
#ifdef __cplusplus
# // c++ code goes here
#endif

# Call C++/CPP function from C Step 2(OMS)
# Make external the function
extern "C" void my_func(void);

cheats.txt  view on Meta::CPAN

docker run -it perl bash

# Go inside a running container.
docker container exec -it feedback-app bash

# Build updated perl image.
docker build -t my-perl .
docker run my-perl -E 'say $^V'

# Rename a docker container
docker container rename <CONTAINER_ID> my-perl-container

# Restart a container
docker container start -a my-perl-container


#############################################################
## Docker Dockerfile Commands
#############################################################
# Dockerfile commands:
# These are executed only during a BUILD.

cheats.txt  view on Meta::CPAN

# Diaply more remote information (shows also HEAD branch)
git remote show origin

# Add remote repository (remote is like an alias)
git remote add origin <url>

# Alter remote repository
git remote set-url origin <url>

# Git. Rename remote repository name
git remote rename origin github

# Do NOT ignore a particular file in git
!<file>
!/.gitignore


#############################################################
## Git - Stage Commands
#############################################################

cheats.txt  view on Meta::CPAN



#############################################################
## Perl Modules - Excel::Writer::XLSX
#############################################################

# Excel - Simple: Generate a blank xlsx file
perl -MExcel::Writer::XLSX -E "$wb = Excel::Writer::XLSX->new('my.xlsx'); $wb->close"

# Excel - Simple: Check for errors openning an excel file and write to a cell
# Also rename the worksheet
perl -MExcel::Writer::XLSX -E "$wb = Excel::Writer::XLSX->new('my.xlsx') or die qq($!\n); $ws = $wb->add_worksheet('my'); $ws->write('A1', 'Hello Excel'); $wb->close"

# Excel - Simple: Add a format to make a cell bold
perl -MExcel::Writer::XLSX -E "$wb = Excel::Writer::XLSX->new('my.xlsx') or die qq($!\n); $ws = $wb->add_worksheet('my'); $format = $wb->add_format; $format->set_bold; $ws->write(0, 0, 'Hello Excel', $format); $wb->close"

# Create a spreadsheet/excel with formulas using perl (only on lnxbr42)
perl -MExcel::Writer::XLSX -le '
   $wb=Excel::Writer::XLSX->new("new.xlsx");
   $ws=$wb->add_worksheet;
   $ws->write("A1","In Excel");

cheats.txt  view on Meta::CPAN

Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox
echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox


#############################################################
## SQLite3 Database
#############################################################

# Install sqlite on Unix (after in zipping the amalgamation file. make sure these 3 are present:
# shell.c, sqlite3.c, sqlite3.h). rename to a.out to sqlite3
# (database, sqlite3)
gcc shell.c sqlite3.c -lpthread -ldl

# View all the tables in a database (database, sqlite3)
sqlite3 my.db '.tables'

# Turn on column names on query results (database, sqlite3)
sqlite3 my.db '.explain on' 'select * from page_groups'

# Print database structure and data (database, sqlite3)

cheats.txt  view on Meta::CPAN

## Ubuntu - Desktop/Tasklist App
#############################################################

# Sample .desktop file to add xair as a favorite program.
cat xair.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=XAIR
# If file name is to be renamed, also probably need to update this class,
# (as is done now).
# Run:
#   xprop WM_CLASS      # WM_CLASS(STRING) = "X-AIR-Edit", "X-AIR-Edit"
StartupWMClass=X-AIR-Edit
Exec=/home/tim/git/xair/software/latest/RUN.sh
Icon=/home/tim/git/xair/software/latest/xair.png


#############################################################
## VBA Regex

cheats.txt  view on Meta::CPAN

	- Click Apply.
	- Click OK.
#
# Show option:
	- Inside the cmd (folder) key, right-click the HideBasedOnVelocityId DWORD,
		and click Rename.
	- Change the DWORD name from HideBasedOnVelocityId to ShowBasedOnVelocityId,
		and press Enter.
#
# Hide option (undo the change):
	- rename the DWORD from from ShowBasedOnVelocityId to HideBasedOnVelocityId


#############################################################
## Windows - Variables
#############################################################

# Get windows script directory (DOS,pwd,windows vars)
echo %~dp0

# Start in currect script directory (windows vars)



( run in 0.806 second using v1.01-cache-2.11-cpan-b888b73be4d )