Skip to content

Instantly share code, notes, and snippets.

Avatar
💾
atuwa tiika

Nayana Hettiarachchi devzer01

💾
atuwa tiika
View GitHub Profile
View bootlog
sudo log show --predicate "processID == 0" --start $(date "+%Y-%m-%d") --debug
alias bootlog='sudo log show --predicate "processID == 0" --start $(date "+%Y-%m-%d") --debug'
@devzer01
devzer01 / proc_cpuinfo
Created Jul 25, 2020
ACER Aspire 3 A314-32-43NH
View proc_cpuinfo
(chroot) livecd / # cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 21
model : 112
model name : AMD A4-9120e RADEON R3, 4 COMPUTE CORES 2C+2G
stepping : 0
microcode : 0x6006705
cpu MHz : 1361.900
cache size : 1024 KB
@devzer01
devzer01 / docker-compose.yml
Last active Dec 1, 2021
docker-compose mongodb
View docker-compose.yml
version: '3'
services:
database:
image: 'mongo'
container_name: 'my-mongo-container' # give your contatner a name
environment:
- MONGO_INITDB_DATABASE=your-database-name # database name you want to make
- MONGO_INITDB_ROOT_USERNAME=my-container-root-username # set your container root username
- MONGO_INITDB_ROOT_PASSWORD=secret # set your contatner root password
volumes:
View spring-boot-dependencies.xml
<activemq.version>5.15.11</activemq.version>
<antlr2.version>2.7.7</antlr2.version>
<appengine-sdk.version>1.9.77</appengine-sdk.version>
<artemis.version>2.10.1</artemis.version>
<aspectj.version>1.9.5</aspectj.version>
<assertj.version>3.13.2</assertj.version>
<atomikos.version>4.0.6</atomikos.version>
<awaitility.version>4.0.2</awaitility.version>
<bitronix.version>2.1.4</bitronix.version>
<build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
@devzer01
devzer01 / i18n.js
Created Mar 14, 2020
fix one problem and create many for no good reason code
View i18n.js
var content = document.createElement('div')
content.id = 'alert';
content.style.width = '100%';
content.innerHTML = 'tax translation helper is loaded';
content.style.height = '100px';
content.style.textAlign = 'center';
content.style.display = 'none';
var body = document.getElementsByTagName('body')[0];
body.appendChild(content);
@devzer01
devzer01 / kill-pgsql-session.sql
Created Feb 14, 2020
killing postgresql sessions
View kill-pgsql-session.sql
-- this query kills any active session attached to the 'dbname' database, which can prevent you from
-- running certain administrative operations on the database
select pg_terminate_backend(pid)
from pg_stat_activity
where pid IN (select pid from pg_stat_activity where datname = 'dbname');
@devzer01
devzer01 / gitlab-pipeline-trigger-looper.sh
Created Feb 14, 2020
gitlab pipeline run until pass looper.
View gitlab-pipeline-trigger-looper.sh
#!/bin/bash
PRIVATE_TOKEN="create from your gitlab profile"
TRIGGER_TOKEN="get from the project ci/cd triggers"
GITLAB_URL="https://gitlab.com"
PROJECT_ID="you can find this using gitlab api or under the gitlab project settings"
REF="master" #this can also be a branch name or a commit hash
SLEEP_SECONDS=1
while true
do
View tux-shortcuts.txt
# tmux shortcuts & cheatsheet
start new:
tmux
start new with session name:
tmux new -s myname
@devzer01
devzer01 / move.sh
Created Jan 12, 2020
Shell script to be used in emergency when your Final Cut Pro has taken up over 50% of drive space, and you can't operate the Mac in any normal fashion
View move.sh
#!/bin/bash
EXTERNAL_BACKUP_DIR="/Volumes/data disk"
LIBRARY_NAME=$1
mv "$LIBRARY_NAME" $EXTERNAL_BACKUP_DIR/ & #send the move to background
# monitor the destination path
raw footage library % lastSize=`du -s "$EXTERNAL_BACKUP_DIR/$LIBRARY_NAME" | tr '\t' ' ' | cut -d' ' -f1`;
while true
@devzer01
devzer01 / panic.report.txt
Created Jan 11, 2020
kernel panic mac os catalina
View panic.report.txt
panic(cpu 4 caller 0xffffff7f8132f948): "XHC2(MacBookPro15,3): thunderbolt power on failed 0xffffffff\n"@/BuildRoot/Library/Caches/com.apple.xbs/Sources/IOPCIFamily/IOPCIFamily-370.80.1/IOPCIBridge.cpp:1398
Backtrace (CPU 4), Frame : Return Address
0xffffffa3bfc83a60 : 0xffffff8000937beb
0xffffffa3bfc83ab0 : 0xffffff8000a6f4b5
0xffffffa3bfc83af0 : 0xffffff8000a60f2e
0xffffffa3bfc83b40 : 0xffffff80008dea40
0xffffffa3bfc83b60 : 0xffffff80009372d7
0xffffffa3bfc83c60 : 0xffffff80009376bb
0xffffffa3bfc83cb0 : 0xffffff80010ce059
0xffffffa3bfc83d20 : 0xffffff7f8132f948