Skip to content

Instantly share code, notes, and snippets.

@yancyn
yancyn / write.py
Last active November 13, 2018 03:25
Write Log File to Pi
import datetime
import threading
def refresh():
# refresh every 10 minutes
threading.Timer(600.0, refresh).start()
fs = open("active.log","a")
i=datetime.datetime.now()
print >>fs, i.isoformat()
@yancyn
yancyn / gmail.md
Created January 4, 2018 06:17
Forward Gmail to Multiple Email
@yancyn
yancyn / aws.md
Last active September 22, 2022 14:17
Monitor Memory Utilization on AWS EC2 Windows Instance

Monitor Memory Utilization on AWS EC2 Windows Instance

How to Enable Memory Monitor

  1. AWS Console > Intance > Action
  2. Attach IAM role to your instance.
  3. Attach policy > CloudWatchFullAccess + AmazonSSMFullAccess.
  4. Start Windows instance.
  5. Configure CloudWatch.json based on your requirement before Ec2Config service is started.
  • Configure your region i.e. if your instance at us-web-2b set to us-west-2.
  • Add your IAM access key and secret key under CloudWatch component.

Install Citrix Receiver On Ubuntu

  1. Download debian installer from Citrix receiver download page.
  2. Copy Thawte Premium Server CA Root to ICA client installed cert folder.
  3. Login your appstogo page and you should be now able to launch your app.
$ sudo dpkg -i icaclientWeb_13.7.0.10276927_amd64.deb
$ sudo cp ~/Downloads/ThawtePremiumServerCA.pem /opt/Citrix/ICAClient/keystore/cacerts/ThawtePremiumServerCA.crt
@yancyn
yancyn / compilec.md
Last active September 28, 2017 05:59
Compile C Source Code in Ubuntu

Steps

  1. $ gedit hello.c
  2. $ gcc hello.c -o hello
  3. $ .hello

hello.c

#include <stdio.h>
int main() {
 printf("Hello World\n");
@yancyn
yancyn / git-svn.md
Last active February 9, 2024 17:44
Migrate Archive Google Code SVN to Git

Migrate Archive Google Code SVN to Git

Requirements

  • git
  • git-svn

Setup¹

$ sudo apt-get install git
$ sudo add-apt-repository ppa:git-core/ppa
@yancyn
yancyn / diskpart.md
Last active May 25, 2017 01:48
How to Format SD Card

How to Format SD Card

cmd > diskpart
DISKPART > list disk
DISKPART > select Disk #
# DISKPART > clean
DISKPART > format fs=fat32 quick

If format command fail, you can use disk management in Windows to format and create volume.

@yancyn
yancyn / chrome-ubuntu.md
Last active October 11, 2017 07:50
Install Chrome on Ubuntu 14.04

Install Chrome on Ubuntu 16.04

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i --force-depends google-chrome-stable_current_amd64.deb

Install Chrome on Ubuntu 14.04

$ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
$ sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" &gt;&gt; /etc/apt/sources.list.d/google-chrome.list'
@yancyn
yancyn / AdventureWorkDW2014-Cube.md
Created March 21, 2017 11:01
Install AdventureWork Data Warehouse 2014

Install AdventureWork Data Warehouse 2014

Create AdventureWorkDW Database

  1. Download Adventure Works 2014 Warehouse Script.zip.
  2. Unzip to C:\Program Files\Microsoft SQL Server\120\Tools\Samples\Adventure Works 2014 Warehouse Script\
  3. SQL Management Studio > Connect to MSSQL Server > Run instawdbdw.sql.

Deploy Cube

  1. Download AW Multidimensional Models SQL Server 2014.zip
  2. Open solution AWDW2014Multidimensional-EE.sln in SQL Server Data Tools (Visual Studio).
  3. Modify AdventureWorksDW2014.ds to using your local settings.
@yancyn
yancyn / jekyll-ubuntu.md
Last active July 13, 2019 06:17
Setup Jekyll on Ubuntu 16.04

Pre-requisition*

$ sudo apt-get update
$ sudo apt-get upgrade

*if fail see Upgrade Ubuntu 16.04 Live Stick

Ubuntu 16.04

$ sudo apt-get install ruby ruby-dev make gcc