Skip to content

Instantly share code, notes, and snippets.

View nampdn's full-sized avatar
🌓
New creation in Christ!

Nam Pham nampdn

🌓
New creation in Christ!
  • Somewhere on Earth
View GitHub Profile
pragma solidity ^0.4.15;
contract StringsAndBytes {
/* --- public variables for storing tests results */
string public lastTestStringResult; //
bytes32 public lastTestBytes32Result; //
bytes public lastTestBytesResult; // bytes: dynamically-sized byte array
bool public lastTestBoolResult; //
@nampdn
nampdn / clean.sh
Created October 15, 2020 02:14 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@nampdn
nampdn / add-remove-public-read-s3.txt
Created September 22, 2020 01:21 — forked from anuragmathur1/add-remove-public-read-s3.txt
s3cmd examples to add and remove public-read access for s3 buckets, folders and objects within.
## You may choose to remove --recursive if is required only for the bucket or folder and not for objects within.
s3cmd setacl --acl-private --recursive s3://mybucket-name
s3cmd setacl --acl-private --recursive s3://mybucket-name/folder-name
s3cmd setacl --acl-private --recursive s3://mybucket-name/folder-name/object-name
s3cmd setacl --acl-public --recursive s3://mybucket-name
s3cmd setacl --acl-public --recursive s3://mybucket-name/folder-name
s3cmd setacl --acl-public --recursive s3://mybucket-name/folder-name/object-name
@nampdn
nampdn / s3_set_object_public.sh
Created September 17, 2020 16:44 — forked from alexclifford/s3_set_object_public.sh
Make S3 object public and private via s3cmd command line
s3cmd setacl s3://bucket/path/to/file --acl-public
s3cmd info s3://bucket/path/to/file
s3cmd setacl s3://bucket/path/to/file --acl-private
var StrippedString = OriginalString.replace(/(<([^>]+)>)/ig,"");
//From http://css-tricks.com/snippets/javascript/strip-html-tags-in-javascript/
@nampdn
nampdn / m3u8-to-mp4.md
Created February 6, 2020 02:09 — forked from tzmartin/m3u8-to-mp4.md
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@nampdn
nampdn / nginx-latest.sh
Created May 15, 2018 02:18 — forked from Globegitter/nginx-latest.sh
Install the latest nginx from source for Ubuntu 14.04
# Automatically instal the latest nginx
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
#Make a backup copy of your current sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Now copy the following repositories to the end of ` /etc/apt/sources.list`
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
#!/bin/sh
if grep -q "com.android.support:support-v4:26.0.0" platforms/android/build.gradle; then
echo "build.gradle already fixed"
else
echo "configurations.all {\nresolutionStrategy.force 'com.android.support:support-v4:26.0.0'\n}" >> platforms/android/build.gradle
echo "android platform fixed"
fi
@nampdn
nampdn / HLS.md
Last active November 16, 2018 01:14 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@nampdn
nampdn / starUML.md
Created February 10, 2018 04:32 — forked from trandaison/starUML.md
Get full version of StarUML

StarUML

Download: StarUML.io

Crack

Source: jorgeancal

After installing StartUML successfully, modify LicenseManagerDomain.js as follow:

/**