Skip to content

Instantly share code, notes, and snippets.

View lamlion's full-sized avatar
🎯
Focusing

Feisal Lam-Lion lamlion

🎯
Focusing
View GitHub Profile
@lamlion
lamlion / Windows10AWSEC2.md
Created May 14, 2019 21:50 — forked from peterforgacs/Windows10AWSEC2.md
Running Windows 10 on AWS EC2

Running Windows 10 on AWS EC2

Downloading the image

Download the windows image you want.

AWS vmimport supported versions: Microsoft Windows 10 (Professional, Enterprise, Education) (US English) (64-bit only)

So Home wont work.

@lamlion
lamlion / testflask_dht22_temp.py
Created March 1, 2019 23:29
Sample Flask app to read DHT22 temperature
from flask import Flask
import Adafruit_DHT
app = Flask(__name__)
@app.route('/hello')
def helloWorldHandler():
return 'Hello World from Flask running on the PI!'
@lamlion
lamlion / dht22temp.py
Created March 1, 2019 23:27
DHT22 Python Temperature script
# Raspberry Pi Tips & Tricks - https://raspberrytips.nl
import Adafruit_DHT
humidity, temperature = Adafruit_DHT.read_retry(Adafruit_DHT.DHT22, 4)
humidity = round(humidity, 2)
temperature = round(temperature, 2)
if humidity is not None and temperature is not None:
@lamlion
lamlion / make_mojave_iso.sh
Last active November 18, 2020 21:51
Create MacOS ISO
#!/bin/bash
# Install OSX Mojave through App Store. After downloading, the "InstallESD" is automatically mounted, which causes this script to fail.
# Therefore, "/Volumes/InstallESD" should be unmounted before running this script!
# Summary of instructions
#1 Download Mojave from App Store
#2 open terminal and run "umount /Volumes/InstallESD"
#3 make script executable: "chmod +x make_mojave_iso.sh"
#4 Run "./make_mojave_iso.sh"
@lamlion
lamlion / BackupWindowsProductKey.vbs
Last active November 15, 2018 22:10
Windows Product key backup script
Option Explicit
Dim objshell,path,DigitalID, Result
Set objshell = CreateObject("WScript.Shell")
'Set registry key path
Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
'Registry key value
DigitalID = objshell.RegRead(Path & "DigitalProductId")
Dim ProductName,ProductID,ProductKey,ProductData
'Get ProductName, ProductID, ProductKey

Keybase proof

I hereby claim:

  • I am lamlion on github.
  • I am lamlion (https://keybase.io/lamlion) on keybase.
  • I have a public key ASD0jFGvf9BCb3YMG0IrgcuKoDMIK4_oT6RnrX7sdiKGYgo

To claim this, I am signing this object:

@lamlion
lamlion / docker-compose.yml
Created June 28, 2018 14:04 — forked from SnowMB/docker-compose.yml
nextcloud_nginx_letsencrypt_mariadb
version: '2'
services:
nginx:
image: jwilder/nginx-proxy
container_name: nginx
ports:
- 80:80
- 443:443
@lamlion
lamlion / bulk_pypdfocr.py
Created June 11, 2018 08:04
Bulk PYPDFOCR Python script
import glob
import os
import re
pwd = os.getcwd()
searchpdf = pwd+'/*/testfile.pdf'
files = glob.glob(searchpdf)
num = len(glob.glob(searchpdf))
@lamlion
lamlion / Mac OS X: Open in Visual Studio Code
Created May 30, 2018 21:26 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@lamlion
lamlion / aws_ami_post_commands.txt
Last active July 7, 2018 00:12
AWS EC2 simple AMI with docker post commands
#!/bin/bash
yum update -y
yum install docker -y
yum install curl -y
yum install git -y
service docker start
curl -L https://github.com/docker/compose/releases/download/1.22.0-rc1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
echo 'export PATH=/usr/local/bin:$PATH' | tee -a /etc/profile –
groupadd docker