Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
#!/bin/sh
set -e
# Get a list of groups a user is a member of on one line, space-seperated
# Single-quote group names with spaces, otherwise print the rest
SPACE_CHAR='-'
TMP=`mktemp`
ldapsearch -H ldap://domain.local -b OU=Everything,DC=domain,DC=local -LLL -x -z0 -D 'CN=gitolite,OU=Engineering,OU=Everything,DC=domain,DC=local' -y /var/lib/git/gitolite_ad_passwd "(sAMAccountName=$1)" userAccountControl memberOf > "$TMP"
@nk23x
nk23x / CentOS_AD_Integration
Last active January 17, 2021 05:40
Active Directory Integration
1. Install the neccessary dependancies
# yum -y install authconfig krb5-workstation pam_krb5 samba-common oddjob-mkhomedir sudo
This will install:
- authconfig which we will use to setup the configuration file basics, there may be parts missing or not quite accurate here, so some of the files seem to need a little massaging to work right later.
- krb5-workstation which installs required libraries and binaries to perform authentication against active directory using the kerberos protocol
- pam_krb5 this package provides libraries for PAM (Pluggable Authentication Modules) to interface with kerberos
- samba-common will installed the required libraries and binaries to join the linux box to the domain so domain accounts are trusted by the local machine
- oddjob-mkhomedir this package is used to automatically create home directories when your AD users log into the server the first time
@nk23x
nk23x / PKGBUILD
Last active August 29, 2015 14:08 — forked from LeifW/PKGBUILD
# Contributor: [Vitaliy Berdinskikh](mailto:ur6lad@archlinux.org.ua) aka UR6LAD
# Contributor: Leif Warner <abimelech@gmail.com>
_timestamp=v20111024
pkgname=jetty
pkgver=8.0.4
pkgrel=1
pkgdesc="A full-fledged production-grade lightweight Java Servlet Container"
arch=('i686' 'x86_64')
url="http://jetty.codehaus.org/jetty/"
license=('Apache' 'EPL')
#===========================================================
# Jetty start.jar arguments
# Each line of this file is prepended to the command line
# arguments # of a call to:
# java -jar start.jar [arg...]
#===========================================================
#===========================================================
@nk23x
nk23x / jetty.xml
Last active August 29, 2015 14:08 — forked from apetresc/jetty.xml
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle
    type="manifest"
    name="jetty">
    <service
        name="application/servers/jetty"
        type="service"
        version="1">
        <create_default_instance enabled="false" />
oscillator(s) and their frequencies in hz
1 whitenoise 63.99999999978596405600
2 pinknoise 63.99999999978596405600
3 brownnoise 63.99999999978596405600
4 sine 63.99999999978596405600
5 sine 255.99999999743156867232
6 sine 1023.99999998287712448384
7 square 63.99999999978596405600
8 square 255.99999999743156867232
@nk23x
nk23x / process
Last active January 26, 2017 18:07 — forked from coderofsalvation/process
SOX: PROCESS
#
# soxmasteraudio electribe configuration file
#
[[ ! -n $CLIP ]] && CLIP="3"
# init fx
LIMIT="ladspa tap_limiter.so "tap_limiter" "-"$CLIP 0.0"
SOXREVERB="reverb 20 50 100 50 60 -3" # reverb %,HF-damping %,roomscale %, stereodepth %, pre-delay ms, wet-gain db
[[ -f /usr/lib/ladspa ]] && export LADSPA_PATH="/usr/lib/ladspa"
[[ ! -f /usr/lib/ladspa/transient_1206.so ]] && echo "please download steve Harris's pluginpack (hint: apt-get install swh-plugins)" && exit
@nk23x
nk23x / downsample.bash
Last active January 26, 2017 18:06 — forked from coderofsalvation/downsample.bash
SOX: DOWNSAMPLE
#!/bin/bash
[[ ! -n "$1" ]] && {
echo "Usage: ./downsample <input.wav> <output.wav> "
echo " DOWNSAMPLE=6 MONO=1 ./downsample in.wav out.wav ";
echo " TREBLE=3 RATE=22500 DOWNSAMPLE=4 GAIN=1 ./downsample in.wav out.wav ";
exit
}
calc(){
echo "$1" | bc -l
@nk23x
nk23x / loopcrossfade.sh
Last active May 6, 2020 16:09 — forked from coderofsalvation/loopcrossfade
SOX: CROSSFADE LOOP
# makes a audiofile to loop itself (seamless by using a crossfade trick) (needs sox audio utilities)
# @dependancy sox
# Usage: ./loopcrossfade <input.wav> <faderatio> [outputdir]
#
loopcrossfade(){
input="$1"; faderatio="$2"; outputdir="$3"; tmpinput="/tmp/$(basename "$input").loopcrossfade.wav"
[[ ! -f "$input" ]] && echo "cannot find $1" && exit 1
valid=$(echo "$faderatio > 1.99" | bc -l );
(( $valid == 0 )) && echo "faderatio should be 2.0 or bigger" && exit 1