Skip to content

Instantly share code, notes, and snippets.

ubuntu@instance-20210417-1118:~$ cat /etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
server {
listen 80;
server_name pek http://129.159.246.200/;
root /var/www/pek;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ =404;
}
@catharsis96
catharsis96 / newusercreate.sh
Last active September 3, 2019 13:34
How to create a new user in Linux. Code to insert after "$" symbol
mami@mami:~$ sudo useradd testinguser
mami@mami:~$ sudo passwd testinguser
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
mami@mami:~$ sudo ls -l /home
total 20
drwxr-xr-x 55 alaa alaa 4096 Aug 22 22:00 alaa
drwx------ 2 root root 16384 Jun 5 09:46 lost+found
mami@mami:~$ sudo mkdir /home/testinguser
@catharsis96
catharsis96 / wslxrdp.sh
Created May 4, 2018 20:27
ubuntu on RDP
#!/usr/bin/env bash
echo "Update system and then install xubuntu-desktop"
sudo apt update
sudo apt upgrade -y
sudo apt install -y xubuntu-desktop xorg xrdp
echo "Setting xrdp port to 3390"
sudo sed -i 's/port=3389/port=3390/g' /etc/xrdp/xrdp.ini
##############
## Script listens to serial port and writes contents into a file
##############
## requires pySerial to be installed
import serial
serial_port = '/dev/cu.usbmodem1411';
baud_rate = 115200; #In arduino, Serial.begin(baud_rate)
write_to_file_path = "output.txt";
<?php
require_once 'WindowsAzure.php';
use WindowsAzure\Common\ServicesBuilder;
try {
$connectionString = 'DefaultEndpointsProtocol=https;AccountName=account name;AccountKey=account key';
echo "1";
$blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString);
echo "2";
@catharsis96
catharsis96 / ddv
Created August 11, 2017 10:17
ls -la org/ddv
drwxrwxr-x 3 user user 4096 авг 10 2014 .
drwxrwxr-x 3 user user 4096 авг 10 2014 ..
drwxrwxr-x 2 user user 4096 авг 10 2014 editor
-rw-rw-r-- 1 user user 1576 авг 10 2014 EditorControllerBase$10.class
-rw-rw-r-- 1 user user 1342 авг 10 2014 EditorControllerBase$11.class
-rw-rw-r-- 1 user user 1247 авг 10 2014 EditorControllerBase$12.class
-rw-rw-r-- 1 user user 1805 авг 10 2014 EditorControllerBase$1.class
-rw-rw-r-- 1 user user 1806 авг 10 2014 EditorControllerBase$2.class
-rw-rw-r-- 1 user user 1179 авг 10 2014 EditorControllerBase$3.class
-rw-rw-r-- 1 user user 1180 авг 10 2014 EditorControllerBase$4.class
#include <iostream>
#include <iomanip>
using namespace std;
const unsigned int DIM1 = 3;
const unsigned int DIM2 = 5;
int ary[DIM1][DIM2];
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EnumsAndSwitch
{
class Program
{
using System;
using System.IO;
using System.Text;
using System.Net;
namespace projectCSharp2
{
class Program
{