Skip to content

Instantly share code, notes, and snippets.

View filviu's full-sized avatar

Silviu Vulcan filviu

View GitHub Profile
@filviu
filviu / oracle_basics.md
Created December 5, 2018 09:26
oracle basics

set lines 256 set trimout on set tab off set pagesize 100 set colsep " | "

Initial configuration on a db_swonly installed system

@filviu
filviu / README.md
Created December 5, 2018 09:18
USB reset on linux

unfortunately I haven't noted exactly where I lifted this from

Avoiding reboot: Resetting USB on a Linux machine This post was written by eli on February 1, 2013 Posted Under: Linux Every now and then, some USB device misbehaves badly enough to knock out the entire interface, to the extent that the system doesn’t detect any new USB devices. Or work so well with the existing ones, for that matter. The solution for me until now was to reboot the computer. But hey, I don’t like rebooting Linux! So this script (I call it usbreset) performs a reset to the USB drivers as necessary to bring them back to life. As a side effect, an equivalent to unplugging and replugging all USB devices takes place. If possible, unmount any connected USB storage device (e.g. disk on key) before doing this. Also, if you’re in the middle of printing through a USB device, or some other operation, this will not be graceful. Frankly speaking, I don’t understand exactly how and why this works, and I can’t even tell if this is the smooth

Simple wrapper to launch CygWin Git from windows applications. I use it with Sublime Text Git plugin (so I don't have to maintain .gitconfig, ssh keys, etc both for cygwin and git-bash)

The PATH export is there to permit launching without -l which is slow especially if, like me, you have lots of customizations in your .bashrc.

@filviu
filviu / gist:06c7db5622d0ddd630054f00988abe12
Created September 15, 2017 19:41
ThinkPad 750p memory includes and excludes.txt
DOS Memory Management - Memory Includes and eXcludes for EMM386
B000-B7FF Video (Mono) 2
EA00-F1FF POST 0
F600-FDFF ROM BASIC 1
Steps to patch mvsas for ASUS P9A-I/C2550/SAS/4L Marvell 88SE9485 - proxmox 4 needed it.
Get the patched file, copy to copy of linux headers path
cd /usr/src/
cp -pr linux-headers-4.4.35-2-pve/ /usr/local/src/
apt-get install pve-headers-4.4.35-1-pve
git pull pve-kernel
tar -xf ubuntu-xenial.tgz
OR
@filviu
filviu / freeotp-redisplay.py
Created August 31, 2017 08:36
Python script to recover freeotp tokens. Not mine, but can't remember where I got it...
#!/usr/bin/env python
from __future__ import print_function
import base64
import ctypes
import json
import subprocess
import sys
import xml.etree.ElementTree as ET
@filviu
filviu / migrate.sh
Created May 11, 2017 07:56
migrate proxmox container storage
#!/bin/bash
#
# Filename : migrate
# Description : Migrate Proxmox OpenVZ container from one storage to another
# Author : James Coyle
#
# Version:
# -Date -Author -Description
# 20-11-2013 James Coyle Initial
# 23-11-2015 Patrick Smits Changes to support PVE 4
@filviu
filviu / imgur-desc-down.py
Created June 5, 2016 20:22
Python script to download imgur album together with descritpions. Quick and dirty (api, secret and album id to set in file before running)
#!/usr/bin/python
import textwrap
from urllib import urlretrieve
from progressbar import ProgressBar, Percentage, Bar
from imgurpython import ImgurClient
# API ID AND SECRET - REQUIRED
@filviu
filviu / edit.sh
Created June 2, 2016 09:03
Sniped used to edit configuration files using a template like file variable=value
#APPLICATION_ENV_SETTINGS is a file containing settings in format file variable=value
print_msg "Applying custom settings"
tr -d '\r' < "${APPLICATION_ENV_SETTINGS}" | while IFS='= ' read TARGETFILE VARNAME VARVALUE; do
# Don't declare variables here, you are in a sub-shell that dies
# when exitting while.
if [[ ! $TARGETFILE =~ ^\ *# && -n $TARGETFILE ]]; then
VARVALUE="${VARVALUE%%\#*}" # Del in line right comments
VARVALUE="${VARVALUE%%*( )}" # Del trailing spaces
VARVALUE="${VARVALUE%\"*}" # Del opening string quotes
@filviu
filviu / get-aix-deps.sh
Last active July 15, 2016 07:42
Script to get package deps of one AIX open source package. Parameter is url of deps file from http://www.oss4aix.org/download/rpmdb/deplists/aix71/
#!/bin/bash
curl -s $1 | while read i; do curl http://www.oss4aix.org/download/everything/RPMS/$i -o $i;done
curl http://www.oss4aix.org/download/everything/RPMS/$( basename $1 | sed -e 's/\.ppc\.deps/\.ppc\.rpm/') -o $( basename $1 | sed -e 's/\.ppc\.deps/\.ppc\.rpm/')