Skip to content

Instantly share code, notes, and snippets.

View annalinneajohansson's full-sized avatar
🐱

Anna annalinneajohansson

🐱
  • Frontwalker Group AB
  • Sweden
  • 12:36 (UTC +02:00)
View GitHub Profile
@annalinneajohansson
annalinneajohansson / fix_dropbox_permissions.sh
Last active August 29, 2015 14:14
"What do I do if Dropbox is stuck syncing, won't launch, or reports an error?" https://www.dropbox.com/help/72
#!/bin/bash
## If your Dropbox folder is not ~/Dropbox, make sure you modify all the commands to point to the correct location.
sudo chown "$USER" "$HOME"
sudo chown -R "$USER" ~/Dropbox ~/.dropbox ~/.dropbox-dist
sudo chattr -R -i ~/Dropbox
sudo chmod -R u+rw ~/Dropbox ~/.dropbox ~/.dropbox-dist
@annalinneajohansson
annalinneajohansson / remap-caps-lock.sh
Last active August 29, 2015 14:14
remap Caps Lock and Ins keys
#!/bin/bash
xmodmap -e "keycode 66 = Shift_L"
xmodmap -e "keycode 118 = Caps_Lock"
@annalinneajohansson
annalinneajohansson / websearch.sh
Last active August 29, 2015 14:14
Execute a web search in the default web browser from the shell with (websearch <provider> <searchterm>)
#!/bin/bash
if [ -z "$1" ]; then
echo "No searchterm given"
else
if [ "$1" = "wordpress" ]; then
x-www-browser https://www.wordpress.org/search/$2
elif [ "$1" = "github" ]; then
#!/bin/bash
sleep 1
xrandr --output DFP10 --mode 1920x1080 --pos 1920x0 --rotate normal --output DFP11 --mode 1920x1080 --pos 0x0 --rotate normal --output CRT1 --off --output DFP8 --off --output DFP9 --off --output DFP6 --off --output DFP7 --off --output DFP4 --off --output DFP5 --mode 1920x1080 --pos 3840x0 --rotate left --output DFP2 --off --output DFP3 --off --output DFP1 --off
@annalinneajohansson
annalinneajohansson / new-ssh-shortcut.sh
Last active February 8, 2020 02:36
Generate a xfce4 panel shortcut (.desktop file). Change "launcher-10" to whatever launcher is used.
#!/bin/bash
echo "Enter host (defined in ~/.ssh/config):"
read host
if [ -z "${host}" ]; then
echo "No host given. Exiting."
else
@annalinneajohansson
annalinneajohansson / "must haves"
Last active August 29, 2015 14:12
My Chrunchbang setup
sudo apt-get install lxappearance
@annalinneajohansson
annalinneajohansson / copy_id_rsa_contents
Created December 12, 2014 09:01
copy id_rsa.pub contents via command line
xclip -sel clip < ~/.ssh/id_rsa.pub
# Play/Pause
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
# Next
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
# Previous
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
# Stop
@annalinneajohansson
annalinneajohansson / dequeue_paupress_scripts.php
Last active February 9, 2017 17:14
Dequeue #PauPress plugin scripts on all admin pages besides the ones where they are actually needed.
<?php
add_action( 'wp_print_scripts', 'dequeue_paupress_scripts', 99999 );
function dequeue_paupress_scripts() {
if( is_admin() ) :
$current = get_current_screen();
$allowed_screens = array(
'users',
'toplevel_page_paupress_options',
@annalinneajohansson
annalinneajohansson / hip_acf_columns.php
Created September 17, 2014 14:44
Adds a rules column to ACF field groups overview
<?php
add_filter( 'manage_edit-acf-field-group_columns', 'hip_acf_columns', 9999 );
add_filter( 'manage_acf-field-group_posts_custom_column', 'hip_acf_columns_html', 9999 );
function hip_acf_columns( $columns ) {
$columns['rules'] = __( 'Rules', THEME_TEXTDOMAIN );
return $columns;
}
function hip_acf_columns_html( $column, $post_id ) {
$field_group = get_post( $post_id );