Skip to content

Instantly share code, notes, and snippets.

View ibakirov's full-sized avatar
:atom:
@_@

Ilyas Bakirov (aka eRIC) ibakirov

:atom:
@_@
  • IBX
  • Kazakhstan
View GitHub Profile
@narkisr
narkisr / ubunt-desktop.seed
Created September 30, 2011 23:23
An Ubuntu desktop preseed file
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/splash boolean false
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i console-setup/variantcode string
# network
d-i netcfg/get_nameservers string
d-i netcfg/get_ipaddress string
d-i netcfg/get_netmask string 255.255.255.0
@colinmollenhour
colinmollenhour / imap_learn.sh
Created November 21, 2012 21:10
IMAP Learn
#!/bin/bash
#
# IMAP Learn
#
# Copyright 2012 Colin Mollenhour (http://colin.mollenhour.com)
#
###############################################################################
#
# This script allows you to use an imap account to train your spamassassin server.
# Example script:
@marklit
marklit / playbook.yml
Created November 8, 2014 08:27
Setup a load-balanced, two-node Django cluster
---
- name: SSH tightening
hosts: all
sudo: True
tasks:
- name: Disable root's ssh account
action: >
lineinfile
dest=/etc/ssh/sshd_config
@ripper
ripper / sshd_tunnel.sh
Last active June 27, 2023 16:09
A script to launch user sshd limited to creation of reverse tunnels
#!/bin/sh
AUTHORIZED_KEYS=authorized_keys
HOST_RSA_KEY=ssh_host_rsa_key
SSHD=/usr/sbin/sshd
PORT=8443
case "$AUTHORIZED_KEYS" in /*) ;; *) AUTHORIZED_KEYS=$PWD/$AUTHORIZED_KEYS ;; esac
case "$HOST_RSA_KEY" in /*) ;; *) HOST_RSA_KEY=$PWD/$HOST_RSA_KEY ;; esac
@m-ou-se
m-ou-se / replace-debian-with-arch.txt
Last active October 22, 2023 12:16
Instructions to replace a live Debian installation with Arch
# Download latest archlinux bootstrap package, see https://www.archlinux.org/download/
wget 'ftp://ftp.nluug.nl/pub/os/Linux/distr/archlinux/iso/latest/archlinux-bootstrap-*-x86_64.tar.gz'
# Make sure you'll have enough entropy for pacman-key later.
apt-get install haveged
# Install the arch bootstrap image in a tmpfs.
mount -t tmpfs none /mnt
cd /mnt
tar xvf ~/archlinux-bootstrap-*-x86_64.tar.gz --strip-components=1
server {
listen 127.0.0.1:80;
ssi on;
gzip on;
gzip_comp_level 7;
gzip_types application/x-javascript application/javascript text/css;
server_name test.ru www.test.ru;
charset off;
#disable_symlinks if_not_owner from=$root_path;
@simonw
simonw / recover_source_code.md
Last active January 16, 2024 08:13
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@llj098
llj098 / Makefile
Created December 23, 2010 01:36
a sample tcp server runs in kernel
obj-m += tcp_svr_sample.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clea

Machine Learning Week 1 Quiz 2 (Linear Regression with One Variable) Stanford Coursera

Github repo for the Course: Stanford Machine Learning (Coursera)

Question 1

Consider the problem of predicting how well a student does in her second year of college/university, given how well she did in her first year.

Specifically, let x be equal to the number of "A" grades (including A-. A and A+ grades) that a student receives in their first year of college (freshmen year). We would like to predict the value of y, which we define as the number of "A" grades they get in their second year (sophomore year).

@F21
F21 / signing-gpg-keys.md
Last active April 17, 2024 14:37
Signing someone's GPG key

This is a quick guide of the commands we use to sign someone's GPG key in a virtual key signing party.

Note: The steps cover only the technical aspects of signing someone's key. Before signing someone's key, you must verify their identity. This is usually done by showing government-issued ID and confirming the key's fingerprint

The commands will work for both GPG and GPG2.

I use Julian's key for the examples. His key id is 2AD3FAE3. You should substitute with the appropriate key id when running the commands.

Signing the key

  1. List the keys currently in your keyring: gpg --list-keys.