Skip to content

Instantly share code, notes, and snippets.

View vampy's full-sized avatar

Daniel Butum vampy

View GitHub Profile
@vampy
vampy / set-displays-brightness.py
Last active February 20, 2021 07:04
Script to set monitor brightness on laptop + all external screens
#!/usr/bin/env python
import sys
import os
import re
SCRIPT_NAME = os.path.basename(__file__)
def help():
print(f"Usage: {SCRIPT_NAME} <brightness>")
sys.exit(4)
@vampy
vampy / WarriOrbDefaultInputSettings.ini
Last active October 21, 2020 10:12
WarriOrb Default Input Settings v1.3
[/Script/Engine.InputSettings]
-AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
-AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
+AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
@vampy
vampy / how-to-be-miserable.md
Created July 3, 2020 10:37 — forked from hcgatewood/how-to-be-miserable.md
Checklist of strategies from Randy Paterson's How to Be Miserable: 40 Strategies You Already Use

Adopting a miserable lifestyle

  • 1. Avoid all exercise
  • 2. Eat what you're told
  • 3. Don't waste your life in bed
  • 4. Live better through chemistry
  • 5. Maximize your screen time
  • 6. If you want it, buy it
  • 7. Can't afford it? Get it anyway!
  • 8. Give 100 percent to your work
@vampy
vampy / remove-whitespaces.py
Created November 5, 2016 12:06
Remove whitespaces/tabs from different files
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# 2014, By konstin (http://github/konstin)
# 2015, Modified by leyyin
#
# Removes all trailing whitespaces and replaces all tabs with four spaces, the
# files with a given extension in a recursively searched directory.
# It can also count the number of code lines excluding comments and blank
# lines.
@vampy
vampy / .clang-format
Last active November 5, 2016 13:02
Clang format scrips files I use
# See https://clangformat.com/
# http://clang-format.me/
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
Language: Cpp
# The extra indent or outdent of access modifiers, e.g. public:
AccessModifierOffset: -4
# If true, horizontally aligns arguments after an open bracket.

1. Backup /etc

tar -zcvf backup_etc.tar.gz /etc/

2. Backup mysql databases

mysqldump -u root -p --all-databases | gzip > backup_mysql-$(date '+%Y-%m-%d_%H-%M-%S' ).sql.gz
@vampy
vampy / ppa-list-all.sh
Created July 14, 2016 11:42
Script to get all the PPA installed on a system
#!/bin/bash
# Script to get all the PPA installed on a system
for APT in `find /etc/apt/ -name \*.list`; do
grep -Po "(?<=^deb\s).*?(?=#|$)" $APT | while read ENTRY ; do
HOST=`echo $ENTRY | cut -d/ -f3`
USER=`echo $ENTRY | cut -d/ -f4`
PPA=`echo $ENTRY | cut -d/ -f5`
#echo sudo apt-add-repository ppa:$USER/$PPA
if [ "ppa.launchpad.net" = "$HOST" ]; then

1. Get all installed packages

adb shell 'pm list packages -f' | sed -e 's/.*=//' | sort > backup_apps.txt

2. Copy all pictures

adb pull -p /mnt/sdcard/DCIM/Camera backup_pictures
@vampy
vampy / awesome-pdf.md
Last active May 9, 2017 19:50
A curated list of amazingly awesome PDF programs, resources and shiny things.

Awesome PDF

PDFCrop is a Perl script that crops the white margins of PDF pages and rescales them to fit a standard size sheet of paper. It makes the printed pages far more attractive to read!

Usage

This project aims to offer a simple cross-platform application for cropping PDF files. A simple user interface lets you define exactly the crop-region by fitting a rectangle on the visually overlaid pages.