Skip to content

Instantly share code, notes, and snippets.

View ahmad-moussawi's full-sized avatar
🎹
Playing 🎶

Ahmad Moussawi ahmad-moussawi

🎹
Playing 🎶
View GitHub Profile
@ahmad-moussawi
ahmad-moussawi / sftp-ubuntu.md
Created March 8, 2022 14:25 — forked from lymanlai/sftp-ubuntu.md
Basic tutorial for creating a SFTP-only user on Ubuntu 9.04 and greater

Adding SFTP-only user to Ubuntu Server

To add a SFTP-only user, you'll need to make sure your SSH config settings are correct, add a new user/group and set permissions for your new user. For step-by-step directions, see below. Omit sudo if you're logged in as root.

Directions

  1. Edit /etc/ssh/sshd_config and make sure to add the following at the end of the file:

     Match group filetransfer
    

ChrootDirectory %h

@ahmad-moussawi
ahmad-moussawi / CSharpErrorsAndWarnings.md
Created September 25, 2020 10:22 — forked from thomaslevesque/CSharpErrorsAndWarnings.md
All C# errors and warnings. Generated by the code in this repo: https://github.com/thomaslevesque/GenerateCSharpErrors. Last updated 2019/06/14, Roslyn commit d5b8d64b4d840b26c947abd2a00b1070cbee55f0.

All C# errors and warnings

Parsed from the Roslyn source code using Roslyn.

Code Severity Message
CS0006 Error Metadata file '{0}' could not be found
CS0009 Fatal Metadata file '{0}' could not be opened -- {1}
CS0012 Error The type '{0}' is defined in an assembly that is not referenced. You must add a reference to assembly '{1}'.
CS0016 Error Could not write to output file '{0}' -- '{1}'
@ahmad-moussawi
ahmad-moussawi / CompilingCSharpCode.cs
Created January 29, 2020 08:40 — forked from RickStrahl/CompilingCSharpCode.cs
A few different approaches to dynamically execute C# code dynamically at runtime from a string of code.
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Scripting;
using Microsoft.CodeAnalysis.Scripting;
using Mono.CSharp;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Diagnostics;
using System.Dynamic;
using System.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Reflection.Emit;
using System.Collections.Concurrent;
using System.Data;
using System.Reflection;
@ahmad-moussawi
ahmad-moussawi / $namedRoute.js
Created May 13, 2018 08:12 — forked from stakach/$namedRoute.js
Augments AngularJS $route provider with route naming.
(function(angular) {
'use strict';
/*
Usage:
-----
FILE --app.js--
@ahmad-moussawi
ahmad-moussawi / sign.sh
Created November 29, 2017 14:15 — forked from ezimuel/sign.sh
Sign and verify a file using OpenSSL command line tool. It exports the digital signature in Base64 format.
#!/bin/bash
# Sign a file with a private key using OpenSSL
# Encode the signature in Base64 format
#
# Usage: sign <file> <private_key>
#
# NOTE: to generate a public/private key use the following commands:
#
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem