Skip to content

Instantly share code, notes, and snippets.

View reza's full-sized avatar
:atom:

Reza Hashemi reza

:atom:
  • Sydney, Australia
View GitHub Profile
@roustem
roustem / Setting-up-Windows-WSL1.md
Last active February 25, 2024 07:12
Setting-up-Windows-WSL1
@noelbundick
noelbundick / LICENSE
Last active May 24, 2024 09:10
Exclude WSL installations from Windows Defender realtime protection
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@reza
reza / ansible-aws-cloud-init.sh
Last active December 25, 2017 06:04
ansible-aws-cloud-init.sh
#!/bin/bash
# Ver 2.1, By Reza Hashemi
# Automate EC2 instance setup and Install latest Ansible and its dependencies via pip (recommended method)
# The cloud init script detects the EC2 instance platform at launch and uses preferred package manager
# AWS cloud init script to install ansible on startup, autodetects required package manager
# Add as user data inside advanced details at AWS EC2 configure instance details (step 3)
# Changes:
# Ver 2.1 Tested on Centos 6
# No issues with pynacl and cryptography
# Ver 2 Tested on RHEL, Centos 7, Ubuntu, SUSE, Fedora 23-25, Debian
@reza
reza / fix-rubygems-source.sh
Created July 9, 2017 16:38
gem install rails not working after upgrading to ruby 2.4.1: ERROR: Could not find a valid gem 'rails' (>= 0), here is why: Unable to download data from https://production.s3.rubygems.org - no such name (https://production.s3.rubygems.org/specs.4.8.gz)
#!/bin/sh
gem source -r https://production.s3.rubygems.org
gem source -a https://rubygems.org
@orenitamar
orenitamar / Dockerfile
Last active March 22, 2024 05:13
Installing numpy, scipy, pandas and matplotlib in Alpine (Docker)
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib
# in an Alpine based Docker image.
FROM alpine:3.4
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip install numpy scipy pandas matplotlib
@bruth
bruth / add-docker-user.sh
Last active January 27, 2021 17:37
Setup Official Docker Repo on RHEL 7
#!/bin/bash
/usr/sbin/usermod -aG docker <user>
@ostinelli
ostinelli / jenkins_ci_on_osx.md
Last active February 28, 2023 02:38
Setup Jenkins CI on OSX.

Jenkins CI on OSX

Instructions on how to setup a secured Jenkins CI on a Mac.

Download & Install dependencies

All of these operations are done with your admin user.

Developer tools

Install the command line developer tools.

@taviso
taviso / newpid.c
Created April 14, 2015 13:35
Apport/Abrt Vulnerability Demo Exploit.
#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <signal.h>
#include <elf.h>
#include <err.h>
#include <syslog.h>
#include <sched.h>
@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active June 10, 2024 09:43
Opening and closing an SSH tunnel in a shell script the smart way

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost