Skip to content

Instantly share code, notes, and snippets.

View gh0stwizard's full-sized avatar

Vitaliy V. Tokarev gh0stwizard

View GitHub Profile
@gh0stwizard
gh0stwizard / debian-6-7-apt-install-workaround.txt
Last active November 14, 2022 21:38
Debian 6, 7 install workaround
Mirror: archive.debian.org
chroot /target
cat > /etc/apt/apt.conf.d/10no--check-valid-until
Acquire::Check-Valid-Until "0";
APT::Get::AllowUnauthenticated "true";
Acquire::AllowInsecureRepositories "true";
@gh0stwizard
gh0stwizard / LINQExtensionToDynamic.cs
Last active December 6, 2018 10:34
LINQExtensionToDynamic.cs: convert queryable<Entity> to queryable<object> at runtime
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Nequeo.Reflection; /* https://github.com/nequeo/misc/blob/master/csharp/DynamicTypeBuilder.cs */
/*
This is a proof of concept how create at runtime the code like this:
var query = datacontext.Users.Where(x => x.IsActive);
var results = query.Select(x => new { Id = x.Id, Name = x.Name });
@gh0stwizard
gh0stwizard / forward.conf
Last active November 27, 2018 09:32
pdns-recursor 4.1.3 centos 7 x86_64 zero ttl patch
+.=10.10.10.1,10.10.10.2
#!/bin/sh
#
# Delete messages from postfix queue by specified MAILFROM & MAILTO
#
# Usage: clean-mail-queue.sh [MAILFROM] MAILTO
#
PATH=/bin:/sbin:/usr/bin:/usr/sbin
@gh0stwizard
gh0stwizard / latest-ffmpeg-centos6.sh
Last active July 27, 2017 06:48 — forked from mustafaturan/latest-ffmpeg-centos6.sh
Installs latest ffmpeg on Centos 6
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide
# yum install -y autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel freetype-devel speex-devel
dldir=$HOME/ffmpeg_sources
prefix=$HOME/ffmpeg_build
bindir=$HOME/bin
CURL="curl -L -C - -O"
[[ ! -e ${dldir} ]] && (mkdir -p ${dldir} || exit 1)
@gh0stwizard
gh0stwizard / CentOS-Source.repo
Created June 23, 2017 07:56
CentOS 6 source repository
[base-source]
name=CentOS-$releasever - Base Source
baseurl=http://vault.centos.org/centos/$releasever/os/Source/
gpgcheck=1
enabled=1
gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-6
protect=1
[updates-source]
name=CentOS-$releasever - Updates Source