Skip to content

Instantly share code, notes, and snippets.

View trinvh's full-sized avatar

Tri Nguyen trinvh

View GitHub Profile
/// <summary>
/// A listing of ASCII control characters for readability.
/// </summary>
public static class AsciiControlChars
{
/// <summary>
/// Usually indicates the end of a string.
/// </summary>
public const char Nul = (char)0x00;
1. Go to Module Admin.
2. Click Apache Config.
3. Scroll to bottom, look at "Override a Virtual Host Setting" section, select your vhost from dropdowns.
4. In "Custom Entry" field, paste the following code:
`DocumentRoot "/var/sentora/hostdata/[username]/public_html/[domain-alias]/public"`
Replace [username] with your login username, and [domain-alias] with your domain directory friendly name (domain.com => domain_com).
5. "Save Host" and waiting for Sentora Daemon, or from terminal, reload httpd service:
From terminal:
1: yum install epel*
2: yum update / yum upgrade
3: Add repo source
- CentOS and Red Hat Enterprise Linux 6.x
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm
When download a github content, it thows following error:
"ERROR: certificate ....To connect to raw.github.com insecurely, use `--no-check-certificate'"
Problem:
+ Unset valid time/timezone.
+ CA Certificate invalid.
Resolve:
@trinvh
trinvh / MomentDateTimeDirective.js
Created February 24, 2017 14:05
Angular 1.x moment input directive with validators and formatters
function momentDateTime() {
var format = "YYYY-MM-DD HH:mm"
//date.isValid() is not enough for strict validation, see moment.js doc
var pattern = /^\s*\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}(:\d{2})?\s*$/
return {
restrict: 'A',
require: 'ngModel',
link: function (scope, element, attr, ngModel) {
ngModel.$parsers.push(function (text) {
var date = moment(text, format);
@trinvh
trinvh / Emulator Guide.md
Created March 28, 2017 16:55 — forked from patrickkettner/Emulator Guide.md
Quick guide on settings up emulators for various mobile platforms.

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru

public class CertificateViewModel
{
public int Id { get; set; }
public AccountViewModel Account { get; set; }
public CertificateType Type { get; set; }
public CertificateRegionType Region { get; set; }
public class CertificateApiEditModel : IValidatableObject
{
[Required]
public CertificateType? Type { get; set; }
[Required]
public CertificateRegionType? Region { get; set; }
//[MustBeTrue]
public bool SignedOff { get; set; }