Skip to content

Instantly share code, notes, and snippets.

View fuzzmz's full-sized avatar

Serban Constantin fuzzmz

View GitHub Profile
@fuzzmz
fuzzmz / empty_rpm.md
Last active January 14, 2024 09:12
How to build an empty .rpm file

How to create an empty .rpm file

First create a package_name.spec file with the following content:

Summary: Summary here
Name: package_name
Version: 0
Release: 0

License: Public

@fuzzmz
fuzzmz / extract.bat
Created June 7, 2012 21:52
Recursively extract archives in nested folders with 7-zip
FOR /D /r %%F in ("*") DO (
pushd %CD%
cd %%F
FOR %%X in (*.rar *.zip) DO (
"C:\Program Files\7-zip\7z.exe" x %%X
)
popd
)
@fuzzmz
fuzzmz / redirect.html
Created December 4, 2012 11:06
HTML redirect
<html>
<head>
<title>Your Page Title</title>
<meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com">
</head>
<body>
Optional page text here.
</body>
</html>
@fuzzmz
fuzzmz / vbox_start.sh
Created August 22, 2013 14:16
Shell script to start a headless virtualbox vm from a snapshot.
#!/bin/bash
EXPECTED_ARGS=2
if [ $# -ne $EXPECTED_ARGS ]; then
echo "Usage: $0 VMNAME_or_UUID SNAPSHOTNAME"
exit 1
fi
set -x
VBoxManage controlvm "$1" poweroff #enforce turnoff
VBoxManage snapshot "$1" restore "$2" #restore snapshot

Keybase proof

I hereby claim:

  • I am fuzzmz on github.
  • I am fuzzmz (https://keybase.io/fuzzmz) on keybase.
  • I have a public key whose fingerprint is 44A6 A30E 3CC8 09D6 FD0F E8CB 5F86 00B3 80FC 7048

To claim this, I am signing this object:

@fuzzmz
fuzzmz / gist:4111521
Created November 19, 2012 16:11
git revert to specific commit
git reset 56e05fced #resets index to former commit; replace '56e05fced' with your commit code
git reset --soft HEAD@{1} #moves pointer back to previous HEAD
git commit -m "Revert to 56e05fced"
git reset --hard #updates working copy to reflect the new commit
@fuzzmz
fuzzmz / email.sh
Created March 30, 2013 22:55
Script to send email on Debian based server at shutdown and restart.
#!/bin/sh
### BEGIN INIT INFO
# Provides: SystemEmail
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Send email
# Description: Sends an email at system start and shutdown
### END INIT INFO
@fuzzmz
fuzzmz / timing.py
Created January 27, 2014 14:02
Measure the execution time of a python script
import atexit
from time import clock
def secondsToStr(t):
return "%d:%02d:%02d.%03d" % \
reduce(lambda ll,b : divmod(ll[0],b) + ll[1:],
[(t*1000,),1000,60,60])
line = "="*40
def log(s, elapsed=None):
@fuzzmz
fuzzmz / accurev_wksp_change.md
Created May 16, 2013 11:04
Change accurev workspace location on disk

How to change the location of an AccuRev workspace on disk

Let's say that you moved your workspace from the folder in which you initially created it and now want to make AccuRev aware of the new location for the files.

In order to change the location of a workspace the following command must be used:

accurev chws -w foo_workspace -l .

Notes:

curl 'https://disqus.com/api/3.0/users/details.json?user=username:fuzzmz&api_secret=REPLACE_ME'