Skip to content

Instantly share code, notes, and snippets.

View MSavameri's full-sized avatar
:octocat:

Meysam Savameri MSavameri

:octocat:
View GitHub Profile
import {catchError, map} from 'rxjs/operators';
import {Inject, Injectable} from '@angular/core';
import {HttpClient, HttpErrorResponse} from '@angular/common/http';
import {Observable} from 'rxjs/internal/Observable';
import {environment} from '../../../environments/environment';
import {User} from '../user/user';
import {Model} from '../abstract/model';
import {zip} from 'rxjs';
@troyfontaine
troyfontaine / readme.md
Last active September 17, 2024 19:33
Resize root partition (or how to remove the default /home partition) on CentOS 7 online

Resize root partition (or how to remove the default /home partition) on CentOS 7 online

This process requires that you are able to ssh OR log in locally using the root user account and that no services be running as users out of /home on the target machine.

The examples are from a default installation with no customization-you NEED to know what you're working with for volumes/partitions to not horribly break things.

By default, CentOS 7 uses XFS for the file system and Logical Volume Manager (LVM), creating 3 partitions: /,/home and swap.

NOTE: If you want to be sure that nothing is writing to /home you can either modify the host to boot into single-user mode OR try to use the systemctl isolate runlevel1.target command to switch (not tested! should work).

@lkaczanowski
lkaczanowski / CustomHandleErrorAttribute.cs
Last active November 14, 2020 00:33
Custom ASP.NET MVC handle error attribute. Handles and logs all errors.
public class CustomHandleErrorAttribute : HandleErrorAttribute
{
private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public override void OnException(ExceptionContext filterContext)
{
if (!filterContext.HttpContext.IsCustomErrorEnabled)
{
return;
}
@martinnormark
martinnormark / BusinessLogicInstaller.cs
Created July 17, 2012 09:17
Castle Windsor IoC Container setup for ASP.NET MVC
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using MyApp.BusinessLogic.Facades;
namespace MyApp.Web.PresentationLogic.Container
{
public class BusinessLogicInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)