Skip to content

Instantly share code, notes, and snippets.

@weshouman
weshouman / lock checker
Created April 25, 2014 03:50
check whom is taking the apt-get lock
ps aux | grep apt | grep -v 'grep'
#(Function credit: usenet archive)
#add me to ~/.bashrc or ~/.bash_profile
#then anywhere in the shell u could write $ path to get the path in a nice format
function path(){
old=$IFS
IFS=:
printf "%s\n" $PATH
IFS=$old
@weshouman
weshouman / backup stashes to files
Last active October 28, 2017 06:48
git stash saver! #vcs
#!/bin/bash
# This may not be the best -or even a good- practice! but it works well for my requirements, and that has no guarantees it should work well in all cases
# Stashes are OVERWRITTEN, so if u had anything named stash[0-9]+.diff it will be OVERWRITTEN, this was an intended behavior for my case, no checks are provided :-|
# No Warranties at all, just have your backups available ^_^
# This code is more focused on trying different shell scripting operations
git stash list > ./stash_list_temp
# to assign use equal directly after the variable name
@weshouman
weshouman / Delete others
Last active October 28, 2017 06:48
remove all files except for specified ones #bash
find . -type f -not -name '*.s' -not -name '*.sh' -not -name '*.txt' | xargs rm
@weshouman
weshouman / listing git files
Last active October 28, 2017 06:47
[GIT files basics] #vcs
#tracked ones
git ls-tree -r master --name-only
#this one works too!
git ls-files
#all files that ever existed
git log --pretty=format: --name-only --diff-filter=A | sort - | sed '/^$/d'
@weshouman
weshouman / tutorials and comments
Last active December 8, 2017 11:42
Kris Occhipinti filesystem #study
#---------- Mounting ISO images linux tutorial ----------#
#http://youtu.be/Tsyk6vLr91k
mkdir mymountpoint
sudo mount ubuntu_or_whatever.iso mymountpoint/
#that's expected that an iso mounted would be write protected/read only =D
#just like a CD
sudo umount mymountpoint/
#some filesystems need the "-o loop" option
@weshouman
weshouman / PPAs
Last active October 28, 2017 06:45
some useful PPAs #important
## Blender
sudo add-apt-repository ppa:irie/blender
## GIMP
sudo add-apt-repository ppa:otto-kesselgulasch/gimp
## Seems a good resource
# itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/
## to remove any ppa
@weshouman
weshouman / BlenderSetup
Last active October 28, 2017 06:45
that's more of some notes for post-Blender-installation on Ubuntu #blender
after installing Blender:
:-> disable the minimize vs move camera <ctrl + alt + 0>
- from System Settings -> keyboard -> shortcuts -> Windows -> Minimize window ... disable :D
:-> disable the move window vs add loopcut <alt + select>
- install CCSM (Compiz Configuration Settings Manager)
- from Window Management section: under move window ... change alt + button1 to alt + super + button 1
@weshouman
weshouman / .bashrc
Last active November 1, 2023 13:27
After installation todos #important #bash #linux #git
# I usually add a similar block to the .bashrc
####################################
##### My Stuff: Walid Shouman ####
####################################
# disable freezing, follow https://unix.stackexchange.com/a/72092/310075
stty -ixon
#~~~~~~~~~~~~~~~~~~~~~~~#
@weshouman
weshouman / LubuntuAutostart
Last active October 28, 2017 06:44
adding shell commands to the autostart of Radxa (lubuntu) #bash
sudo nano /etc/xdg/lxsession/Lubuntu/autostart
then add ur shell script there