Skip to content

Instantly share code, notes, and snippets.

View thosuperman's full-sized avatar

Tho Nguyen thosuperman

View GitHub Profile
@thosuperman
thosuperman / gist:35d82d5fb7511f4fe7e2cde64d2f16e9
Created February 27, 2024 14:01 — forked from sebsto/gist:6af5bf3acaf25c00dd938c3bbe722cc1
Start VNCServer on Mac1 EC2 Instance
# YouTube (english) : https://www.youtube.com/watch?v=FtU2_bBfSgM
# YouTube (french) : https://www.youtube.com/watch?v=VjnaVBnERDU
#
# On your laptop, connect to the Mac instance with SSH (similar to Linux instances)
#
ssh -i <your private key.pem> ec2-user@<your public ip address>
#
# On the Mac

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@thosuperman
thosuperman / gist:7d82effff351aeb2f40e8bc1e0f4f33e
Created March 8, 2019 07:42 — forked from adamstac/gist:7462202
Install and configure Sendmail on Ubuntu

Install and configure Sendmail on Ubuntu

This should help you get Sendmail installed with basic configuration on Ubuntu.

  1. If sendmail isn't installed, install it: sudo apt-get install sendmail
  2. Configure /etc/hosts file: nano /etc/hosts
  3. Make sure the line looks like this: 127.0.0.1 localhost yourhostname
  4. Run Sendmail's config and answer 'Y' to everything: sudo sendmailconfig
  5. Restart apache sudo service apache2 restart
@thosuperman
thosuperman / gist:18faf346a54d5ed7ccb61e334fe3deaf
Created March 6, 2019 06:57 — forked from rjfranco/gist:60646e527651728e69c3
Getting Symlinks in Vagrant on Windows 10 with VirtualBox 5
- Add this line in Vagrant File
# Enables symlinks on Windows VBox
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"]
- in an admin command prompt, run:
fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
- boot vagrant from new admin powershell session
<?php include "../inc/dbinfo.inc"; ?>
<html>
<body>
<h1>Sample page</h1>
<?php
/* Connect to MySQL and select the database. */
$connection = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD);
if (mysqli_connect_errno()) echo "Failed to connect to MySQL: " . mysqli_connect_error();
@thosuperman
thosuperman / EOSTrinhDinhPhuong.sol
Created October 31, 2018 03:53
EOSTrinhDinhPhuong.sol
pragma solidity 0.4.11;
contract DSNote {
event LogNote(
bytes4 indexed sig,
address indexed guy,
bytes32 indexed foo,
bytes32 indexed bar,
uint wad,
bytes fax
@thosuperman
thosuperman / Ethereum-Installing-Geth-On-Centos.txt
Created October 15, 2018 03:58
Ethereum Installing Geth On Centos
Building
$ sudo yum install golang
$ sudo yum install gmp-devel
$ git clone https://github.com/ethereum/go-ethereum
$ cd go-ethereum/
$ make geth
$ ls -al build/bin/geth
Running
## How to install mcrypt in php7.2
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
##
#
# Check version php and pecl
#
php -v # if default php is not 7.2 then use /usr/bin/php7.2 instead php
@thosuperman
thosuperman / 00. tutorial.md
Created September 24, 2018 08:54 — forked from maxivak/00. tutorial.md
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
- Install cygwin if using Windows:
https://cygwin.com/install.html
- Make sure installed these packages:
+ curl
+ python (2.7.x)
+ python-jinja
+ python-crypto
+ python-openssl
+ python-setuptools