Skip to content

Instantly share code, notes, and snippets.

@ejimz
ejimz / gist:621d9ae02c13cfc4e244
Last active October 5, 2015 14:56
turn "dns spoofing ssh check" off
#Add a file named "config" in "~/.ssh/" dir wuth this content
Host 10.0.*
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
# it would affect just to networks 10.0.*, if you want to apply it to all the network change it to *
@ejimz
ejimz / gist:acede426ee62770c5870
Last active September 21, 2021 00:19
dpkg-rpm equivalent map
Feature rpm deb
----------------------------------------------------------------------------------
View all installed packages rpm -qa dpkg -l, dpkg-query -Wf '${Package}\n'
View package info, installed package rpm -qi packagename (1) apt-cache show packagename
View pre/post install shell scripts rpm -q --scripts packagename cat /var/lib/dpkg/info/packagename.{pre,post}{inst,rm}
View changelog for a package file rpm -qp --changelog ./packagename.rpm dpkg-deb --fsys-tarfile packagename.deb | tar -O -xvf - ./usr/share/doc/packagename/changelog.gz | gunzip
Uninstall a package rpm -e packagename apt-get remove/purge packagename
Upgrade a package from a file rpm -Uvh ./packagename.rpm dpkg -i packagename.deb
Find which package owns a file rpm -qif /some/file.foo dpkg -S /dome/file.foo
List dependencies of a package
@ejimz
ejimz / gist:1a4399e76862836f49c7
Last active August 29, 2015 14:06
Varnish cheat sheet
# clear all cache on demand
varnishadm "ban req.url ~ /"
# clear url context cache
varnishadm "ban req.url ~ /a/context"
@ejimz
ejimz / gist:a43ba758a521b8c118ed
Last active August 29, 2015 14:01
Solr init.d script
#
# description: Starts and stops Solr
# Source debian init.d function library.
. /lib/lsb/init-functions
# options that are commonly overridden
SOLRROOT=/opt/solr
SOLRHOME=solr
LISTENPORT=8983
@ejimz
ejimz / gist:8053093
Created December 20, 2013 10:38
conf logstash
input {
file{
type => nginx
path => ["/var/log/nginx/access.log", "/var/log/nginx/error.log"]
tags => ["frontend"]
}
}
filter {
@ejimz
ejimz / vimrc
Last active December 30, 2015 08:39
Personal vim conf (.vimrc)
" enable syntax
sy on
" set my fav colorscheme
colorscheme elflord
" highlight current line
set cul
hi CursorLine term=none cterm=none ctermbg=0
@ejimz
ejimz / some_vhosts
Created June 19, 2013 15:38
Exclude static content from proxypass in a vhosts
<VirtualHost *:80>
ServerName your_server_name.com
DocumentRoot /var/www/static
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
Alias /css/ /var/www/static/css/