Skip to content

Instantly share code, notes, and snippets.

View elundmark's full-sized avatar
💭
I may be slow to respond.

elundmark

💭
I may be slow to respond.
View GitHub Profile
#!/bin/bash
terminalcmd="lxterminal"
# already running
[[ "$(pgrep -x dmenu)" ]] && exit 0
# delete unsafe old shell file
[[ -f "/tmp/dmenu_run_bash.sh" ]] && rm "/tmp/dmenu_run_bash.sh"
# my default first listed apps
# I usually place this in ~/.bash_aliases as a function
# Usage: $ topc command-name [command-name2 ...]
# This uses pgrep to find any matching commands running, and makes a comma delimited list that top then uses. On ext the command list echoes out in the terminal.
topc () {
cmds=""
if [[ $# -eq 0 ]] ; then
top
else
for cmd in "$@" ; do
# Turns off shadows for Kazam Sreen Recorder, Gimp, and all shaped windows
# echo "shadow-ignore-shaped = true;" >> ~/.config/compton.conf
compton -cC -o 0.6 -r 12 -l -18 -t -12 -G -b \
--no-fading-openclose --shadow-red 0.04 --shadow-green 0 --shadow-blue 0 \
--shadow-exclude='n:w:*Kazam*' \
--shadow-exclude='n:w:*Kazam*' \
--shadow-exclude='n:w:Gimp*' \
--shadow-exclude='n:w:gimp*' \
/*
* Fix font-family:Times showing as Nimbus No9 on Linux
*
* Example (debugging): http://jsfiddle.net/2GzvY/3/embedded/result/
*
* Problem: Specifying "Times" and not "Times New Roman" in your css will render with the Nimbus No9 font.
* Solution: Force the browser to select "Times New Roman" with @font-face rules.
* Dependencies: msttcorefonts installed
* Author: mail@elundmark.se
* Date 2013-10-04

Problem:

Running a .desktop file from anything else than a launcher or a filemanager doesn't work, even if called via xdg-open (bug)

Solution:

Create a python file and call it, passing any .desktop file path.

#!/usr/bin/python
#!/bin/bash
# sudo apt-get install trash-cli zenity
if [[ "`trash-list`" =~ ^[1-2] ]] ; then
# if trash-list returns any files
zenity --question --title "Trashbin" --text "Really empty the trash?" --ok-label "Empty Trash"
[[ $? -eq 0 ]] && trash-empty
else
zenity --info --title "Trashbin is empty" --text "No files found in the trash..."

How TO Install Jedi Academy w/ Wine

I had some problems installing this game, and after searching for any solutions out there I found that I wasn't alone. I was surprised to find that it does install pretty easily, and runs bloody well. I compared the performance with the open sourced version of Jedi Outcast, and considering that Jedi Academy is a bit more resource heavy, it's close to native speeds.

So, the problem I noticed many had, is the installer, because there are 2 CDs, and switching cds in Wine is always a problem, especially when you're mounting them as iso's. Beware that this solution requires you to use a "NoCd" exe, but since you own the original game you have nothing to worry about. Follow these steps:

  1. Pop in the CDs and [convert them to iso images](http://askubuntu.com/questions/136165/how-to-create-iso-
# fixes
alias sudo='sudo'
alias aliases='nano /home/elundmark/.bash_aliases'
# general time savers and remember-me-nots
alias _copy_='xclip -selection clipboard'
alias _paste_='xclip -selection clipboard -o'
alias _copy_last_cmd='/home/elundmark/bin/macro_paste.sh "echo !-1 | _copy_"'
// ==UserScript==
// @name ExFm Downloader (Chrome / Safari)
// @description Allows you to download the songs being played at http://ex.fm/
// @version 1.3.2
// @date 2013-01-11
// @author elundmark
// @contact mail@elundmark.se
// @license MIT License; http://www.opensource.org/licenses/mit-license.php
// @namespace http://elundmark.se/
// @include http*://ex.fm/*

Setup fake HTTPS SSL certificate on Linux

  • Good links to open and read first.
  • Install curl openssl libnss3-tools
  • Open terminal (Become root first ! su -l)
mkdir /etc/ssl/self-signed && cd /etc/ssl/self-signed
openssl genrsa -des3 -out server.key 1024
openssl rsa -in server.key -out server.key.insecure