Skip to content

Instantly share code, notes, and snippets.

View nguyenvanhaivn's full-sized avatar

nguyenvanhaivn

View GitHub Profile
@nguyenvanhaivn
nguyenvanhaivn / Generate register CPUID VMWare and Virtualbox
Created March 12, 2020 07:50
Change the CPU brand on virtualbox and vmware, generating commands for Virtualbox and configuration for VMWare.
#!/bin/bash
#
# change variable vm (only virtualbox) and brand for your use
#
vm='VM' # UUID works as well, only for virtualbox
# The brand string needs to have 47 characters!
# The null terminator is added automatically
brand=' Intel(R) Pentium(R) 4 CPU 1500MHz'
if [ ${#brand} -ne 47 ]; then
exit 1
@nguyenvanhaivn
nguyenvanhaivn / jdk_download.sh
Created September 12, 2019 01:50 — forked from P7h/jdk_download.sh
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@nguyenvanhaivn
nguyenvanhaivn / apt-rdepends-tree
Created September 5, 2019 08:26 — forked from damphat/apt-rdepends-tree
debian dependency tree
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# != 1 ]; then
echo 'Usage: apt-rdepends-tree <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi
@nguyenvanhaivn
nguyenvanhaivn / firebase_copy.js
Created July 11, 2019 08:42 — forked from jofftiquez/firebase_copy.js
Firebase realtime database - how to copy or move data to a new path?
function copyFbRecord(oldRef, newRef) {
return Promise((resolve, reject) => {
oldRef.once('value').then(snap => {
return newRef.set(snap.val());
}).then(() => {
console.log('Done!');
resolve();
}).catch(err => {
console.log(err.message);
reject();
@nguyenvanhaivn
nguyenvanhaivn / ansi-utf8-conversion.md
Created June 28, 2019 03:08 — forked from dogancelik/ansi-utf8-conversion.md
(Windows) ANSI / UTF-8 (with or without BOM) conversion

Using Uni2Me

  • It's free but discontinued.

Using UTFCast

  • Proprietary software
  • Allows conversion from ANSI to UTF-8 with or without BOM

Using Notepad++

@nguyenvanhaivn
nguyenvanhaivn / clone.bash
Created June 26, 2019 07:43 — forked from milanboers/clone.bash
Clone all repositories of a Github user
curl -s https://api.github.com/users/milanboers/repos | grep \"clone_url\" | awk '{print $2}' | sed -e 's/"//g' -e 's/,//g' | xargs -n1 git clone
@nguyenvanhaivn
nguyenvanhaivn / BzIframe.js
Created May 28, 2019 07:39 — forked from iest/BzIframe.js
Basic react iframe with onLoad handler
'use strict';
var React = require('react');
var BzIframe = React.createClass({
propTypes: {
src: React.PropTypes.string.isRequired,
onLoad: React.PropTypes.func
},
@nguyenvanhaivn
nguyenvanhaivn / post2.md
Created May 3, 2019 04:42 — forked from gkastrinis/post2.md
Tablet as second PC monitor

Tablet as second PC monitor

Lately I've been thinking about using my old nexus 7 (from 2012) as a second PC monitor.

I've read articles regarding android apps for this purpose as well as comments from Google Play. Some examples can be found here and here. Bottom line, you have to pay and most likely you will end up struggling with (huge?) lag and/or compatibility issues. I tried splashtop but it felt lacking in some way, it was just mirroring my main monitor and it was free just for the first 5 minutes.

@nguyenvanhaivn
nguyenvanhaivn / configure_apcupsd
Created May 2, 2019 04:15 — forked from gschora/configure_apcupsd
configuring apcupsd to suspend all running VM and then shutdown the esxi 5.5 u1 host
###############################################################################################################
# these are instructions for automating the suspend and shutdown of esxi vm's and host in case of a
# power failure.
# works with apc smartups 750xl and esxi 5.5u1
###############################################################################################################
0# make a new VM and install Ubuntu-Server on it
1# install apcupsd
apt-get install apcupsd
@nguyenvanhaivn
nguyenvanhaivn / embedded-file-viewer.md
Created January 10, 2019 03:50 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links