Skip to content

Instantly share code, notes, and snippets.

View alavitabar's full-sized avatar
🎯
Focusing

Ali Alavitabar alavitabar

🎯
Focusing
View GitHub Profile
@alavitabar
alavitabar / NLogConfig.cs
Created March 6, 2023 12:27 — forked from DForshner/NLogConfig.cs
Programmatically configure NLog
using NLog;
using NLog.Config;
using NLog.Targets;
using NLog.Targets.Wrappers;
using System.Diagnostics;
namespace Web.App_Start
{
/// <summary>
/// Programmatically configure NLog.
@alavitabar
alavitabar / gist:f321536a6bc35181c1defd0bd0cdd53a
Created March 2, 2023 10:46 — forked from rstackhouse/gist:1162357
Configure NLog Programmatically
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NLog;
using NLog.Common;
using NLog.Targets;
using NLog.Config;
namespace ConsoleApplication1

Steps to increase the disk for a vmware centos 8 server

1. Increase the virtual machine disk by using vCenter

Increase the disk space of the machine, using vCenter. If there is any existing snapshot, this could not be done. So any existing snapshot have to be deleted previously.

Not sure if needed, but once the disk space is increased, reboot the machine.

2. Create a new partition disk by using fdisk

@alavitabar
alavitabar / readline.c
Created October 8, 2022 11:28 — forked from yeban/readline.c
A c function to take a string input of arbitrary length.
//the return pointer must be freed
char* readline() {
char buffer;
char *command = NULL;
char *tmp = NULL;
int size = 0;
int last = 0;
while ( 1 ){ //listen indefinitely for characters