Get Specific events within date range with icalbuddy
icalbuddy -sc -f eventsFrom:'November 28, 2011' to:'December 2, 2011'
käme es mir gelegen = es wäre gut für mich.
How do I put GRUB into the boot sector of a partition instead of putting it in the MBR via grub-install?
grub-install --root-directory=/boot /dev/hdb
update-grub
MBR:
boot sector = 448 bytes - 2 equal bytes at the end = 446=bs
partition table info = 46 bytes after boot sector
Totaling to bs=512 count=1
tar -jxf for tar.bz2
hdiutil for conversion img and dmg
hdiutil convert source.img/iso -format UDRW -o output.dmg/***
hdiutil convert some.dmg -format UDTO -o some.dd
optional: conv=sync,noerror
The MBR consists of _three_ parts, not two:
1. The first 446 bytes contain the boot loader.
2. The next 64 bytes contain the partition table (4 entries, each 16 bytes).
3. The last 2 bytes contain the identifier 0xAA55 (or 0x55AA, I forgot).
To copy the boot loader only, one *must* use "bs=446". To copy the partition table only, one must use "bs=1 skip=446 count=64".
To exclude the partition table count=1 bs=446
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The Hackintosh Bootloader (GUID or FDisk partition schemes)
boot0
typically placed in the boot code secion of MBR for a darwin-only system. On some systems, it may not be installed and an alternative primary boot manager (which has its own code) such as LILO may be used.
boot1h
goes in the boot section (first .5KB) of a HFS+ partition, and has enough code to parse an HFS+ volume header, find the extents associated with the "HFS+ Startup File" and load it.
boot
Boot is what is reffered to by the Startup File extents for a HFS+ volume. This is the second-stage loader which is in charge of presenting the list of bootable3 volumes, and if applicatble, loading a kernel + extensions from the filesystem. (cdboot is a modified version of boot for use on CDs)
For a standalone sing-partition HFS install, you would ideally have:
A) boot0 - in the MBR, LILO, or GRUB
B) boot1h - in the first 512-bytes of the HFS+ partition
C) boot - pointed to by the HFS+ Startup File
To install boot0 in the MBR
dd if=/path/to/file/boot0 of=dev/diskX bs=400 count=1
To install boot1h in the bootsector
dd if=/path/to/file/boot1h of=dev/diskXsY bs=512 count=1
To set the HFS+ Startup File
/path/to/file/startupfiletool /dev/rdiskXsY /path/to/file/boot
It is convetional to install boot0, boot1h, and boot to /usr/standalone/i386
In addition, if you are using a FDisk partition scheme, you must set the boot partition of the disk active.
fdisk -e /dev/rdiskX
Ignore the error "fdisk: could not open MBR file..."
p "varifies partition"
f 1 "set partition active"
w "write to partition"
y (yes you are sure)
exit (to quit)
update latex files with sudo mktexlsr
Sunday, January 29, 2012
My howto file in ~/howto
#####################################
#this is text file with useful tips##
#####################################
download youtube with command: youtube-dl
get all links on website: get-links.py #optional: > atextfile.txt
download packages and all dependencies
use 'python grabpackages.py -o '
then copy and paste contents of to command line and push enter to initiate download into current directory.
To save the MBR to a file (this contains the partition table too):
dd if=/dev/hda of=hda-mbr-full bs=512 count=1
To save the MBR, without the partition table, to a file:
dd if=/dev/hda of=hda-mbr-nopart bs=446 count=1
To save a boot sector (e.g. partition 3) to a file:
dd if=/dev/hda3 of=hda3-bootsect bs=512 count=1
MBR TOTAL SIZE = 446 + 64 + 2 = 512
446 bytes - Bootstrap.
64 bytes - Partition table.
2 bytes - Signature.
Use 446 bytes to overwrite or restore your /dev/XYZ MBR boot code only with the contents of $mbr.backup.file.
Use 512 bytes to overwrite or restore your /dev/XYZ the full MBR (which contains both boot code and the drive's partition table) with the contents of $mbr.backup.file.
for example, if identically sized partitions on origin and destination,
this command will copy 512 bytes (MBR) from sda to sdb disk.
dd if=/dev/sda of=/dev/sdb bs=512 count=1
different size partitions-two step process
dd if=/dev/sda of=/tmp/mbrsda.bak bs=512 count=1
dd if=/tmp/mbrsda.bak of=/dev/sdb bs=446 count=1
The above commands will preserve the partitioning schema.
####################
####################
edit a file in root mode with textedit
$ gksudo gedit
set vlc as main media player for everything
gksudo gedit the following and do a search & replace of totem and replace with vlc
/usr/share/applications/defaults.list
check size of directory
$ du -h /foldername --human readable
$ du -ah /foldername --all filenames along with the directory
$ du -c /foldername --grand total
usb-creator-gtk
find router address
$ route -n
OR
$ netstat -r
remove empty folders
find . -type d -empty -delete
recursively move files
find . -name '*.flv' -exec mv {} flv \;
how to extract tar.gz
tar xyvf
how to setup various settings, like auto open a mounted drive in nautilus
gconf-editor
python documentation server
pydoc -g
#####BASH WILDCARDS######
Wildcard Matches
* zero or more characters
? exactly one character
[abcde] exactly one character listed
[a-e] exactly one character in the given range
[!abcde] any character that is not listed
[!a-e] any character that is not in the given range
{debian,linux} exactly one entire word in the options given
#this is text file with useful tips##
#####################################
download youtube with command: youtube-dl
get all links on website: get-links.py
download packages and all dependencies
use 'python grabpackages.py -o
then copy and paste contents of
To save the MBR to a file (this contains the partition table too):
dd if=/dev/hda of=hda-mbr-full bs=512 count=1
To save the MBR, without the partition table, to a file:
dd if=/dev/hda of=hda-mbr-nopart bs=446 count=1
To save a boot sector (e.g. partition 3) to a file:
dd if=/dev/hda3 of=hda3-bootsect bs=512 count=1
MBR TOTAL SIZE = 446 + 64 + 2 = 512
446 bytes - Bootstrap.
64 bytes - Partition table.
2 bytes - Signature.
Use 446 bytes to overwrite or restore your /dev/XYZ MBR boot code only with the contents of $mbr.backup.file.
Use 512 bytes to overwrite or restore your /dev/XYZ the full MBR (which contains both boot code and the drive's partition table) with the contents of $mbr.backup.file.
for example, if identically sized partitions on origin and destination,
this command will copy 512 bytes (MBR) from sda to sdb disk.
dd if=/dev/sda of=/dev/sdb bs=512 count=1
different size partitions-two step process
dd if=/dev/sda of=/tmp/mbrsda.bak bs=512 count=1
dd if=/tmp/mbrsda.bak of=/dev/sdb bs=446 count=1
The above commands will preserve the partitioning schema.
####################
####################
edit a file in root mode with textedit
$ gksudo gedit
set vlc as main media player for everything
gksudo gedit the following and do a search & replace of totem and replace with vlc
/usr/share/applications/defaults.list
check size of directory
$ du -h /foldername --human readable
$ du -ah /foldername --all filenames along with the directory
$ du -c /foldername --grand total
usb-creator-gtk
find router address
$ route -n
OR
$ netstat -r
remove empty folders
find . -type d -empty -delete
recursively move files
find . -name '*.flv' -exec mv {} flv \;
how to extract tar.gz
tar xyvf
how to setup various settings, like auto open a mounted drive in nautilus
gconf-editor
python documentation server
pydoc -g
#####BASH WILDCARDS######
Wildcard Matches
* zero or more characters
? exactly one character
[abcde] exactly one character listed
[a-e] exactly one character in the given range
[!abcde] any character that is not listed
[!a-e] any character that is not in the given range
{debian,linux} exactly one entire word in the options given
Great Free and Useful Software for Apple Macs
ProVoc
Purpose: Learning via flashcards.
Details: It is no longer being developed, but works under Lion. Another developer has used the ProVoc code to create iVocabulary and has also created an iOS app for it. You can create an excel document and export it to a text file, which will import to Provoc properly (if using korean characters or similar, eport to UTF-16 txt). Use column A (language 1), B (language 2), and C (for comments).
Location: http://www.arizona-software.ch/provoc/
Purpose: Learning via flashcards.
Details: It is no longer being developed, but works under Lion. Another developer has used the ProVoc code to create iVocabulary and has also created an iOS app for it. You can create an excel document and export it to a text file, which will import to Provoc properly (if using korean characters or similar, eport to UTF-16 txt). Use column A (language 1), B (language 2), and C (for comments).
Location: http://www.arizona-software.ch/provoc/
Saturday, January 28, 2012
Making Microsoft Word 2011 Mac produce (Xe)(La)TeX Style Outlines for Academic Papers with Applscript
(* Academic Paper Setup Copyright © 2012 Jonathan Komar Just kidding there is no copyright. Open Source rules! You may use this code however you like. It would be nice if you made reference to the original code when sharing. THINGS TO DO: find a fix for changing font color of headings without hardcoding it. fix headings 4-9 *) (*<Properties to be set by the user*) --number suffix corresponds to heading 1, heading 2, etc. --NOTE: To change the coloring of headings, it must be hardcoded. must find a fix. property fontName1 : "CMU Serif Roman" property fontName2 : "CMU Serif Roman" property fontName3 : "CMU Serif Roman" property fontName4 : "CMU Serif Roman" property fontName5 : "CMU Serif Roman" property fontName6 : "CMU Serif Roman" property fontName7 : "CMU Serif Roman" property fontName8 : "CMU Serif Roman" property fontName9 : "CMU Serif Roman" property fontSize1 : 15 property fontSize2 : 14 property fontSize3 : 13 property fontSize4 : 12 property fontSize5 : 12 property fontSize6 : 12 property fontSize7 : 12 property fontSize8 : 12 property fontSize9 : 12 property boldTF : true property italicTF : false property highlightTF : false (*Properties to be set by the user>*) tell application "Microsoft Word" tell active document (*<normal code BLOCK*) set name of font object of Word style style normal to "CMU Serif Roman" set font size of font object of Word style style normal to 12 set bold of font object of Word style style normal to false set italic of font object of Word style style normal to false set color index of font object of Word style style normal to black (*normal code BLOCK>*) (*<heading 1 code BLOCK*) set name of font object of Word style style heading1 to fontName1 set font size of font object of Word style style heading1 to fontSize1 set bold of font object of Word style style heading1 to boldTF set italic of font object of Word style style heading1 to italicTF set color index of font object of Word style style heading1 to black --set paragraph format left indent of paragraph format of Word style style heading1 to (centimeters to points centimeters 0) --indent sections relative to margin --set tab stop position of tab stop of Word style style heading1 to (centimeters to points centimeters 1) --set tab hanging indent of paragraph format of Word style style heading1 to count 1 (*heading 1 code BLOCK>*) (*<heading 2 code BLOCK*) set name of font object of Word style style heading2 to fontName1 set font size of font object of Word style style heading2 to fontSize1 set bold of font object of Word style style heading2 to boldTF set italic of font object of Word style style heading2 to italicTF set color index of font object of Word style style heading2 to black (*heading 2 code BLOCK>*) (*<heading 3 code BLOCK*) set name of font object of Word style style heading3 to fontName1 set font size of font object of Word style style heading3 to fontSize1 set bold of font object of Word style style heading3 to boldTF set italic of font object of Word style style heading3 to italicTF set color index of font object of Word style style heading3 to black (*heading 3 code BLOCK>*) (*<heading 4 code BLOCK*) set name of font object of Word style style heading4 to fontName1 set font size of font object of Word style style heading4 to fontSize1 set bold of font object of Word style style heading4 to boldTF set italic of font object of Word style style heading4 to italicTF set color index of font object of Word style style heading4 to black (*heading 4 code BLOCK>*) (*<heading 5 code BLOCK*) set name of font object of Word style style heading5 to fontName1 set font size of font object of Word style style heading5 to fontSize1 set bold of font object of Word style style heading5 to boldTF set italic of font object of Word style style heading5 to italicTF set color index of font object of Word style style heading5 to black (*heading 5 code BLOCK>*) (*<heading 6 code BLOCK*) set name of font object of Word style style heading6 to fontName1 set font size of font object of Word style style heading6 to fontSize1 set bold of font object of Word style style heading6 to boldTF set italic of font object of Word style style heading6 to italicTF set color index of font object of Word style style heading6 to black (*heading 6 code BLOCK>*) (*<heading 7 code BLOCK*) set name of font object of Word style style heading7 to fontName1 set font size of font object of Word style style heading7 to fontSize1 set bold of font object of Word style style heading7 to boldTF set italic of font object of Word style style heading7 to italicTF set color index of font object of Word style style heading7 to black (*heading 7 code BLOCK>*) (*<heading 8 code BLOCK*) set name of font object of Word style style heading8 to fontName1 set font size of font object of Word style style heading8 to fontSize1 set bold of font object of Word style style heading8 to boldTF set italic of font object of Word style style heading8 to italicTF set color index of font object of Word style style heading8 to black (*heading 8 code BLOCK>*) (*<heading 9 code BLOCK*) set name of font object of Word style style heading9 to fontName1 set font size of font object of Word style style heading9 to fontSize1 set bold of font object of Word style style heading9 to boldTF set italic of font object of Word style style heading9 to italicTF set color index of font object of Word style style heading9 to black (*heading 9 code BLOCK>*) end tell (*<apply numbering to the sections code BLOCK*) set selFind to find object of selection --selects text of execute find command clear formatting selFind --reset selFind just to make sure set style of selFind to style heading1 --set style we are looking for execute find selFind find text "" wrap find find continue with find format and match forward if found of selFind is true then --display dialog (get content of text object of selection) --for debugging only (*<code BLOCK word__set paragraph style*) --I apply the formatting to the previously found text set myLT to list template 5 of list gallery 3 of active document apply list format template (list format of text object of selection) ¬ list template myLT end if (*Apply numbering to the sections code BLOCK>*) (******************************************* (*<code BLOCK word_get style.scpt*) --i select the header 1 stuff set selFind to find object of selection --selects text of execute find command clear formatting selFind --reset selFind just to make sure set style of selFind to style heading1 --set style we are looking for execute find selFind find text "" wrap find find continue with find format and match forward if found of selFind is true then --display dialog (get content of text object of selection) --for debugging only (*<code BLOCK word__set paragraph style*) --I apply the formatting to the previously found text set theRange to text object of active document --i say where to apply the script set myStyle to Word style of object of selection of active document --debug only --set myStyle to make new Word style at active document with properties ¬ {name local:"Section", style type:style type paragraph} tell font object of selFind set name to fontName1 set font size to fontSize1 set bold to true end tell set myLT to list template 5 of list gallery 3 of active document apply list format template (list format of text object of selection) ¬ list template myLT (*code BLOCK word__set paragraph style>*) --set style of theRange to myStyle --i actually apply the settings update styles active document end if (*code BLOCK word_get style.scpt>*) *********************************) end tell
Friday, January 20, 2012
Applescript: Open multiple websites in tabs with Firefox
#open websites in tabs with firefox
set list_Sites to {"http://www.google.at", "http://www.yahoo.com"}
tell application "Firefox"
activate
repeat with a in list_Sites
do shell script "open -a Firefox" & space & quoted form of a
end repeat
end tell
set list_Sites to {"http://www.google.at", "http://www.yahoo.com"}
tell application "Firefox"
activate
repeat with a in list_Sites
do shell script "open -a Firefox" & space & quoted form of a
end repeat
end tell
Thursday, January 19, 2012
Python Script to Open Webpages in Firefox tabs (or any browser supported by the python webbrowser library)
#python
import webbrowser
a = ['http://www.google.com/reader','http://www.yahoo.com/','http://www.facebook.com/']
for x in a:
webbrowser.get('firefox').open_new_tab(x)
You just need to copy and paste that code into a text file and save it as something like "opensite.py" (better to use the .py extension)
Make it executable running the following command in terminal:
sudo chmod a+x opensite.py
Run it either in the command line with
python /path/to/opensite.py
Or create a launcher (you can do this in Ubuntu easily by right clicking on the desktop)
Firefox Download Files to Specific Folders Frequently
Hey firefox users:
Useful tip for firefox (if you use firefox). Ever wish you download files directly to a specific folder without having to move them later. For example, I have a folder structure like this:
~/University/Winter2011/Media Class
I want to download documents for my Media Class into that folder frequently.
You can get an "add-on" for firefox called "save file to" and it will allow you to easily set up such folders as download locations. I am using save file to 2.2"
I find it to be quite useful!
Useful tip for firefox (if you use firefox). Ever wish you download files directly to a specific folder without having to move them later. For example, I have a folder structure like this:
~/University/Winter2011/Media Class
I want to download documents for my Media Class into that folder frequently.
You can get an "add-on" for firefox called "save file to" and it will allow you to easily set up such folders as download locations. I am using save file to 2.2"
I find it to be quite useful!
Subscribe to:
Posts (Atom)