Skip to content

Instantly share code, notes, and snippets.

@syaifulnizamyahya
syaifulnizamyahya / WindowsDefender.txt
Created March 24, 2018 13:56
Prevent Windows Defender from deleting/quarantining files
Edit Windows Defender setting to prevent deleting unharmful files
From Admin Powershell
Turn off Automatic Remediation:
REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v DisableRoutinelyTakingAction /t REG_DWORD /d 1 /f
Turn on Automatic Remediation:
REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v DisableRoutinelyTakingAction /f
@syaifulnizamyahya
syaifulnizamyahya / dump.txt
Last active November 17, 2017 06:35
C# Print out all contents in an object
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
public static string Dump(object target)
{
string json = JsonConvert.SerializeObject(target);
JToken jt = JToken.Parse(json);
return jt.ToString();
}
sudo firewall-cmd --permanent --zone=public --add-port=19999/tcp
sudo firewall-cmd --reload
@syaifulnizamyahya
syaifulnizamyahya / unmount.gdrive.sh
Created June 18, 2017 15:13
Unmount google drive
#!/usr/bin/bash
echo Unmount AllMovies
fusermount -u /mnt/user/Media/AllMovies/
echo Unmount Movies
fusermount -u /mnt/user/Media/Movies/
echo Unmount MoviesKids
fusermount -u /mnt/user/Media/MoviesKids/
@syaifulnizamyahya
syaifulnizamyahya / mount.gdrive.sh
Created June 18, 2017 15:12
Google Drive mounting command
#!/usr/bin/bash
echo Mount log $(date) $'\r'$'\r'
echo "Starting Cloud Mounts" $'\r'
#mongodb and unionfs must be installed first
#get client id and secret
#client id .apps.googleusercontent.com
#client secret _iu1
#create mongodb db directory /mnt/user/appdata/plexdrive/data/db if its still not created
sv_cheats 1
nav_generate
tf_bot_quota 11
tf_bot_difficulty 0
tf_bot_melee_only 1
@syaifulnizamyahya
syaifulnizamyahya / acmvx.snippet
Last active June 1, 2017 05:13
MvvmCross Code Snippet for Visual Studio
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>MvvmCross async command</Title>
<Description>MvvmCross async command</Description>
<Shortcut>acmvx</Shortcut>
<Author>Syaiful Nizam Yahya (based on Mikkel Jensen)</Author>
<HelpUrl>http://stackoverflow.com/questions/18200679/mvvmcross-code-snippets-for-visual-studio</HelpUrl>
@syaifulnizamyahya
syaifulnizamyahya / UwpNuget
Last active June 15, 2017 22:25
UWP Mush Have Nuget Toolkit
Install-Package WindowsAppStudio.DataProviders
Install-Package WindowsAppStudio.Uwp
Install-Package WindowsAppStudio.Common
Install-Package WindowsAppStudio.Controls -Pre
Install-Package Microsoft.Toolkit.Uwp
Install-Package Microsoft.Toolkit.Uwp.UI
Install-Package Microsoft.Toolkit.Uwp.UI.Animations
Install-Package Microsoft.Toolkit.Uwp.UI.Controls
Install-Package Microsoft.Toolkit.Uwp.Services
@syaifulnizamyahya
syaifulnizamyahya / Template10.xaml
Last active June 21, 2017 04:07
Template10 xaml
xmlns:Behaviors="using:Template10.Behaviors"
xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:controls="using:Template10.Controls"
xmlns:vm="using:XXXXX.ViewModels"
<Page.DataContext>
<vm:XXXXXViewModel x:Name="ViewModel" />
</Page.DataContext>
var task = Task.Run(async () =>
{
LccParamModel = await GetLeastCongestedChannelParams();
});
task.Wait();