Skip to content

Instantly share code, notes, and snippets.

View hugotai101's full-sized avatar
🏠
Working from home

hugotai hugotai101

🏠
Working from home
View GitHub Profile
@hugotai101
hugotai101 / hyper-v-ubuntu-install.sh
Created February 2, 2024 12:28
enable hyper-v enhanced session ubuntu guest.
#!/bin/bash
#
# This script is for Ubuntu 20.04 Focal Fossa to download and install XRDP+XORGXRDP via
# source.
#
# Major thanks to: http://c-nergy.be/blog/?p=11336 for the tips.
#
###############################################################################
@hugotai101
hugotai101 / af.cs
Created May 13, 2021 09:32
Public test
Console.WriteLine("Hi")
@hugotai101
hugotai101 / updateonjoin.sql
Created May 6, 2021 09:38
Update On join table sql
UPDATE
sales.commissions
SET
sales.commissions.commission =
c.base_amount * t.percentage
FROM
sales.commissions c
INNER JOIN sales.targets t
ON c.target_id = t.target_id;
select name, tk.[key], tk.roomname,*
from tbFacility
left join temproomkey tk on name like CONCAT('%', tk.roomname, '%')
$ServerName = '192.168.1.188'
$DatabaseName = 'Dbname'
$UserName = 'username'
$password = 'password'
$connectionString = 'Data Source={0};database={1};User ID={2};Password={3}' -f $ServerName,$DatabaseName,$userName,$password
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection $connectionString
$sqlConnection.Open()
@hugotai101
hugotai101 / macOS_ramdisk.sh
Created June 17, 2018 07:16
Create ramdisk on macOS #macOS
#Size of RAM disk desired(MB) * 2048 = amount to specify
#Using the above example, that would be:
#eg 2GB 2048 * 2048 = 4194304
diskutil erasevolume HFS+ 'RAMDisk' `hdiutil attach -nomount ram://524288` # 0.5GB
diskutil erasevolume HFS+ 'RAMDisk' `hdiutil attach -nomount ram://4194304` # 2GB
diskutil erasevolume HFS+ 'RAMDisk' `hdiutil attach -nomount ram://8388608` # 4GB
diskutil erasevolume HFS+ 'RAMDisk' `hdiutil attach -nomount ram://12582912` # 6GB
@hugotai101
hugotai101 / cloudSettings
Last active October 22, 2017 16:07
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-10-22T16:07:49.429Z","extensionVersion":"v2.8.3"}
public class PhraseOMatic3 {
public static void main(String[] args) {
String[] girls = {"Amanda", "Jessica", "Chrissie"};
String[] verbs = {"loves", "hates"};
String[] boys = {"Andy", "Aaron", "Eason", "Jacky"};
for (String girl : girls) { // for each string in girls[]
int j = (int) (Math.random() * verbs.length);
int k = (int) (Math.random() * boys.length);
System.out.println(girl + " " + verbs[j] + " " + boys[k]);
}