diff --git a/journal/journal_readme.md b/journal/journal_readme.md new file mode 100644 index 0000000..91fab7f --- /dev/null +++ b/journal/journal_readme.md @@ -0,0 +1,5 @@ +# journal +Two simple scripts for making a text file based journal. +nje.sh (new journal entry) creates a new text file in in ~/Dropbox/Apps/Plain.txt/ with the current date and time. +mcj.sh (merge complete journal) creates a text file with the current month as the name and copies +the content of all the journal entries into it. The file names are the headline for each entry. diff --git a/journal/mcj.sh b/journal/mcj.sh new file mode 100644 index 0000000..aa79605 --- /dev/null +++ b/journal/mcj.sh @@ -0,0 +1,12 @@ +#!/bin/bash +##Create a text file which combines all journal entries into one +## and gives it the name of the current month. +for filename in $( ls -r -t *.txt ) +do + if [ "$filename" != "`date +%B`.txt" ] + then + echo "$filename" + cat "$filename" + echo + fi +done > ~/Dropbox/Apps/Plain.txt/`date +%B`.txt diff --git a/journal/nje.sh b/journal/nje.sh new file mode 100755 index 0000000..9274d0f --- /dev/null +++ b/journal/nje.sh @@ -0,0 +1,5 @@ +#!/bin/bash +##a script to quickly create a new text file with the date and time +##as its name. nje stands for new journal entry. +touch ~/Dropbox/Apps/Plain.txt/`date +%F_%T`.txt +exit 0 diff --git a/scripts_for_i3/dmenu-bind b/scripts_for_i3/dmenu-bind new file mode 100644 index 0000000..8465cb1 --- /dev/null +++ b/scripts_for_i3/dmenu-bind @@ -0,0 +1,2 @@ +#!/bin/bash +exe=`dmenu_path | dmenu -n '#151617' -nf '#d8d8d8' -sb '#d8d8d8' -sf '#151617'` && eval "exec $exe" diff --git a/scripts_for_i3/exit_script b/scripts_for_i3/exit_script new file mode 100644 index 0000000..b3ebbc9 --- /dev/null +++ b/scripts_for_i3/exit_script @@ -0,0 +1,146 @@ +#!/usr/bin/env python +# +# Adapted from the original cb-exit script by +# +# Changed to support for systemd +# Added an Openbox --reconfigure option +# +######################################################################## +# If you want a shutdown sound then uncomment and edit line 71 +# +# If you want the dialog undecorated by Openbox, the add the following lines to the +# section in rc.xml +# +# +# no +# yes +# normal +# +# +######################################################################## +# +# February 2015 +# +######################################################################## + +import pygtk +pygtk.require('2.0') +import gtk +import os +import getpass + +class bl_exit: + def disable_buttons(self): + self.cancel.set_sensitive(False) + self.logout.set_sensitive(False) + self.suspend.set_sensitive(False) + self.reboot.set_sensitive(False) + self.shutdown.set_sensitive(False) + + def cancel_action(self,btn): + self.disable_buttons() + gtk.main_quit() + + def logout_action(self,btn): + self.disable_buttons() + self.status.set_label("Exiting Openbox, please standby...") + os.system("openbox --exit") + + def suspend_action(self,btn): + self.disable_buttons() + self.status.set_label("Suspending, please standby...") + os.system("cb-lock") + os.system("systemctl suspend") + gtk.main_quit() + + def reboot_action(self,btn): + self.disable_buttons() + self.status.set_label("Rebooting, please standby...") + os.system("systemctl reboot") + + def shutdown_action(self,btn): + self.disable_buttons() + self.status.set_label("Shutting down, please standby...") + # add shutdown sound here + #os.system("aplay /path/to/exit.wav") + os.system("systemctl poweroff") + + def create_window(self): + self.window = gtk.Window() + title = "Log out " + getpass.getuser() + "? Choose an option:" + self.window.set_title(title) + self.window.set_border_width(5) + self.window.set_size_request(500, 60) + self.window.set_resizable(False) + self.window.set_keep_above(True) + self.window.stick + self.window.set_position(1) + self.window.connect("delete_event", gtk.main_quit) + windowicon = self.window.render_icon(gtk.STOCK_QUIT, gtk.ICON_SIZE_MENU) + self.window.set_icon(windowicon) + + + #Create HBox for buttons + self.button_box = gtk.HBox() + self.button_box.show() + + #Cancel button + self.cancel = gtk.Button(stock = gtk.STOCK_CANCEL) + self.cancel.set_border_width(4) + self.cancel.connect("clicked", self.cancel_action) + self.button_box.pack_start(self.cancel) + self.cancel.show() + + #Shutdown button + self.shutdown = gtk.Button("_Power off") + self.shutdown.set_border_width(4) + self.shutdown.connect("clicked", self.shutdown_action) + self.button_box.pack_start(self.shutdown) + self.shutdown.show() + + #Reboot button + self.reboot = gtk.Button("Re_boot") + self.reboot.set_border_width(4) + self.reboot.connect("clicked", self.reboot_action) + self.button_box.pack_start(self.reboot) + self.reboot.show() + + #Logout button + self.logout = gtk.Button("_Log out") + self.logout.set_border_width(4) + self.logout.connect("clicked", self.logout_action) + self.button_box.pack_start(self.logout) + self.logout.show() + + #Suspend button + self.suspend = gtk.Button("_Suspend") + self.suspend.set_border_width(4) + self.suspend.connect("clicked", self.suspend_action) + self.button_box.pack_start(self.suspend) + self.suspend.show() + + #Create HBox for status label + self.label_box = gtk.HBox() + self.label_box.show() + self.status = gtk.Label() + self.status.show() + self.label_box.pack_start(self.status) + + #Create VBox and pack the above HBox's + self.vbox = gtk.VBox() + self.vbox.pack_start(self.button_box) + self.vbox.show() + + self.window.add(self.vbox) + self.window.show() + + def __init__(self): + self.create_window() + + +def main(): + gtk.main() + +if __name__ == "__main__": + go = bl_exit() + main() diff --git a/scripts_for_i3/search b/scripts_for_i3/search new file mode 100644 index 0000000..8641e4b --- /dev/null +++ b/scripts_for_i3/search @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ -f $HOME/.dmenurc ]; then + . $HOME/.dmenurc +else + DMENU='dmenu -nb '#151617' -nf '#d8d8d8' -sb '#d8d8d8' -sf '#151617'' +fi + +GS=`cat ~/.gshist | $DMENU $*` +[[ $GS = "" ]] && exit + +if grep -q "$GS" "$HOME/.gshist" ; then + echo already exists in history +else + echo $GS >> ~/.gshist +fi + +google-chrome-stable -new-window http://www.google.com/search?q="$GS" +exit 0 diff --git a/various/backup.sh b/various/backup.sh new file mode 100644 index 0000000..7af8af3 --- /dev/null +++ b/various/backup.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +## creating backup folder +mkdir /home/nebucatnetzer/backup + +## creating mysql backup +echo "Enter your MySQL password" +mysqldump -u root -p --all-databases > /home/nebucatnetzer/backup/all_databases.sql + +## backing up the www folder +rsync -a --delete /var/www /home/nebucatnetzer/backup &> /dev/null + +## compressing everything into an date stamped archive +tar -cvzf /home/nebucatnetzer/server_$(date +%Y-%m-%d).tar.gz --directory=/home/nebucatnetzer/backup/ . + +## changing ownership +chown nebucatnetzer:nebucatnetzer server_*tar.gz + +## removing the files +rm -rf /home/nebucatnetzer/backup diff --git a/various/buildserver b/various/buildserver new file mode 100755 index 0000000..cbcf619 --- /dev/null +++ b/various/buildserver @@ -0,0 +1,4 @@ +#!/bin/bash +#exec terminator -x ssh nebucatnetzer@213.239.207.237 +ssh nebucatnetzer@213.239.207.237 +exit 0 diff --git a/various/download_backup.sh b/various/download_backup.sh new file mode 100755 index 0000000..696aa44 --- /dev/null +++ b/various/download_backup.sh @@ -0,0 +1 @@ +scp nebucatnetzer@185.16.173.105:/home/nebucatnetzer/*.tar.gz /home/andreas/various/backup/server diff --git a/various/elinor b/various/elinor new file mode 100755 index 0000000..5ace8c4 --- /dev/null +++ b/various/elinor @@ -0,0 +1,4 @@ +#!/bin/bash +#exec terminator -x ssh nebucatnetzer@213.239.207.237 +ssh andreas@5.172.131.120 +exit 0 diff --git a/various/server b/various/server new file mode 100755 index 0000000..8e54dcb --- /dev/null +++ b/various/server @@ -0,0 +1,3 @@ +#!/bin/bash +ssh nebucatnetzer@185.16.173.105 +exit 0 diff --git a/various/testserver b/various/testserver new file mode 100755 index 0000000..ad7aab8 --- /dev/null +++ b/various/testserver @@ -0,0 +1,3 @@ +#!/bin/bash +ssh root@89.31.135.46 +exit 0 diff --git a/various/xflux b/various/xflux new file mode 100755 index 0000000..22ec556 Binary files /dev/null and b/various/xflux differ