Skip to content

Instantly share code, notes, and snippets.

View filviu's full-sized avatar

Silviu Vulcan filviu

View GitHub Profile
@filviu
filviu / download.php
Created February 12, 2015 08:34
Push a file as a download from php. Useful to force a download on the brain-dead android.
<?php
$file = 'somefile.txt';
header("Content-Description: File Transfer");
header("Content-Type: application/octet-stream");
header('Content-Disposition: attachment; filename="'.basename($file).'"');
readfile($file);
?>
@filviu
filviu / zfs_health.sh
Last active May 4, 2020 07:04
Original from: https://calomel.org/zfs_health_check_script.html The ZFS Health Check script You are welcome to copy and paste the following script. We call the script "zfs_health.sh", but you can use any name you wish. Make sure to set the script to be executable and define your full path to the bash shell binary at the top. Also, take a look at…
#!/bin/bash
#
# Calomel.org
# https://calomel.org/zfs_health_check_script.html
# FreeBSD 9.1 ZFS Health Check script
# zfs_health.sh @ Version 0.15
# Check health of ZFS volumes and drives. On any faults send email. In FreeBSD
# 10 there is supposed to be a ZFSd daemon to monitor the health of the ZFS
# pools. For now, in FreeBSD 9, we will make our own checks and run this script
@filviu
filviu / lcd.py
Created June 18, 2015 10:18
output text on pi GPIO HD44780 lcd
#!/usr/bin/python
#
# HD44780 LCD Test Script for
# Raspberry Pi
#
# Author : Matt Hawkins
# Site : http://www.raspberrypi-spy.co.uk
#
# Date : 26/07/2012
#
@filviu
filviu / ifup-local
Last active August 29, 2015 14:24
Print IP on CentOS 7 after boot
#!/bin/bash
# goes in /sbin !!!
nohup sh -c "sleep 1 ; /usr/local/sbin/update-issue.sh" &
@filviu
filviu / extract_sql.pl
Created October 24, 2015 17:11
Extract table from mysqldump full database dump file. Lifted shamelessly from https://blog.tsheets.com/2008/tips-tricks/extract-a-single-table-from-a-mysqldump-file (it's GPL so it's ok)
#!/usr/bin/perl -w
##############################################################################
##
## Written by: Jared Cheney <[email protected]>
##
## Original Template written by:
## Brandon Zehm <[email protected]> and Jared Cheney <[email protected]>
##
## License:
##
@filviu
filviu / deploy.sh
Last active January 15, 2016 17:24
Script that helps me deploy virtual machines
#!/bin/bash
LV="$1"
distros=( el6 el7 )
LOG="$HOME/deploy.log"
if type tput >/dev/null 2>&1; then
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
@filviu
filviu / launch.sh
Created November 12, 2015 13:13
Launch multiple commands in the background
for i in $(seq 10); do command ARG1 ARG2 > output_$i.txt 2>&1 & sleep $(($RANDOM %3));done
@filviu
filviu / go.md
Last active November 26, 2015 10:19
Deploy my homeshick based dotfiles

How to run

curl -s https://gist.githubusercontent.com/silviuvulcan/219034b94be99ec38fb2/raw/hsdeploy.sh | bash
@filviu
filviu / Controly.md
Created November 23, 2015 19:56
Launchy configurations

evs C:/Program Files (x86)/Evernote/Evernote/ENScript.exe showNotes /q "$$"

evn C:\Program Files (x86)\Evernote\Evernote\Evernote.exe /NewNote

cmd C:\Windows\System32\cmd.exe

@filviu
filviu / 30detectproxy
Created December 2, 2015 10:26
apt-get use a proxy only if available. Shamelessly lifted from here: http://askubuntu.com/questions/53443/how-do-i-ignore-a-proxy-if-not-available
# /etc/apt/apt.conf.d/30detectproxy:
# Fail immediately if a file could not be retrieved. Comment if you have a bad
# Internet connection
Acquire::Retries 0;
# undocumented feature which was found in the source. It should be an absolute
# path to the program, no arguments are allowed. stdout contains the proxy
# server, stderr is shown (in stderr) but ignored by APT
Acquire::http::ProxyAutoDetect "/etc/apt/detect-http-proxy";