Skip to content

Instantly share code, notes, and snippets.

View UlasSAYGINIM's full-sized avatar

Ulaş SAYGIN UlasSAYGINIM

View GitHub Profile
@dlangille
dlangille / 1 - The FileSet
Last active February 28, 2021 23:45
Each jail is in its own fileset. Snapshot each fileset, back it up. Destroy the filesets.
# the filesets will be different on each jail, thus, we'll always be doing a full unless
# we define this for each jail server
#
FileSet {
Name = "zuul jail snapshots"
Include {
Options {
signature = MD5
Exclude = yes
}
@anestv
anestv / UIparallax.html
Created October 19, 2014 12:54
Parallax scrolling for Semantic UI
<html>
<head>
<style>
/* user styles */
body {
max-width: 900px;
margin: auto;
padding: 1em;
}
@anestv
anestv / find friendships
Last active January 11, 2019 21:52
User friend of owner or owner friend of user
SELECT
EXISTS (SELECT friend FROM friends WHERE `user` = '$owner' AND friend = '$user') AS ou, --Owner has User
EXISTS (SELECT friend FROM friends WHERE `user` = '$user' AND friend = '$owner') AS uo; --User has Owner
@hlissner
hlissner / replace.sh
Last active September 11, 2023 10:14
Bulk search & replace with ag (the_silver_searcher)
# ag <https://github.com/ggreer/the_silver_searcher>
# usage: ag-replace.sh [search] [replace]
# caveats: will choke if either arguments contain a forward slash
# notes: will back up changed files to *.bak files
ag -0 -l $1 | xargs -0 perl -pi.bak -e "s/$1/$2/g"
# or if you prefer sed's regex syntax:
ag -0 -l $1 | xargs -0 sed -ri.bak -e "s/$1/$2/g"
@jas-
jas- / readme.md
Last active March 1, 2022 12:57
FreeBSD jail w/ services

myprint.scl.utah.edu

The myprint service handles wireless printing for the MLIB PC labs. FreeBSD is the operating system that was chosen for this service primarily for its security features.

Details on the current configuration of myprint.scl.utah.edu can be found below. 07/12/2013

Host OS configuration

This first section details the various configuration options applied to the kernel, NAT & traffic passing to jailed (non routable net) env, usage of IPFW service to filter incoming & outgoing traffic to specific subnets & or targets, OS, Jail & TCP stack hardening options

@solusipse
solusipse / 01_postfix_installer.md
Last active August 29, 2024 20:43
Postfix + Dovecot + Postgresql + Postfixadmin + Roundcube

Postfix Installer

Following script may be used for configuring complete and secure email server on fresh install of Debian 7. It will probably work on other distributions using apt-get. After minor changes you'll be able to use it on other Linux distros.

Usage

  1. Run postfix.sh script.
  2. Configure postgres to allow connections.
  3. Configure postfix admin. Remember to set these:
@dreamcat4
dreamcat4 / zabbix-config-examples.md
Last active February 28, 2022 05:50
zabbix configuration examples - monitor CPU temperature & hdd status (smart attributes)

Configure zabbix jail

The smartctl program needs direct read access to raw disk devices. To allow that, we must create a devfs ruleset to un-hide our disk devices in the zabbix jail's /dev/ folder.

# Set the jailname
jailname="zabbix"

# Set the ruleset number. Use the last 3 digits of $jail_ip
rule_num="212"
@MortimerGoro
MortimerGoro / gist:73103944326698e57f34
Created June 4, 2014 10:55
Receipt validation using OpenSSL and asn1c.
/* The PKCS #7 container (the receipt) and the output of the verification. */
BIO *b_p7;
PKCS7 *p7;
/* The Apple root certificate, as raw data and in its OpenSSL representation. */
BIO *b_x509;
X509 *Apple;
/* The root certificate for chain-of-trust verification. */
X509_STORE *store = X509_STORE_new();
@Kartones
Kartones / postgres-cheatsheet.md
Last active April 18, 2025 10:32
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@dlangille
dlangille / pkg-audit.sh
Last active March 1, 2022 12:57
Find all pkg audit issues in FreeBSD jails and hosts.
#!/bin/sh
JLS="/usr/sbin/jls"
PKG="/usr/sbin/pkg"
# list of the jail ids for all jails
JAILS=`${JLS} jid`
RESULT=""
CHECKING=$1