Scripts to run specific services
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
namespace UDP | |
{ | |
public class UDPSocket | |
{ | |
public Socket _socket; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I managed to do it with diskpart. What I was missing is the command to create a new partition. So here is a run-down of all the commands I used, step by step. | |
Beware that when typing select disk 1 (step 4), your disk number may be different. Selecting the incorrect disk might erase your whole computer's main disk drive, losing all your data on it. | |
I assume you know how to get to the Run prompt since you have arrived at SU. But if not, just press and hold down the Windows key on your keyboard. While still holding the Windows key, press the R key. Voilà! La Run prompt! L'invite de commande! | |
cmd | |
diskpart | |
list disk | |
select disk 1 (Careful! Choose the correct number here. See note above.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Hosting; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace WebServer.Main | |
{ | |
public class Server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Singleton Pattern | |
// NOTE: The class is marked as sealed to prevent the inheritance of the class (i.e. use it as base/super class). | |
internal sealed class Singleton | |
{ | |
private static readonly object SingletonSyncRoot = new object(); | |
private static volatile Singleton _instanceSingleton; | |
// NOTE: Default/Parameterless constructor is private to prevent instantiation of the class. | |
private Singleton() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout servername.key -out servername.crt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# description: Apache Tomcat init script | |
# processname: tomcat | |
# chkconfig: 234 20 80 | |
# | |
# | |
# Copyright (C) 2014 Miglen Evlogiev | |
# | |
# This program is free software: you can redistribute it and/or modify it under |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Example: Grab the value for the MYSQL_USER key | |
User=$( sed -n 's/.*"MYSQL_USER": "\(.*\)",/\1/p' /var/lib/credentials.json ) | |
## Example: Grab the value for the MYSQL_PASSWORD key | |
Passwd=$( sed -n 's/.*"MYSQL_PASSWORD": "\(.*\)",/\1/p' /var/lib/credentials.json ) |