<commit_before>#!/bin/bash

clear_up_safari() {
    #
    # Copy/paste this command and point it at wherever you put this script
    # sudo defaults write com.apple.loginwindow LogoutHook "/Users/pingnak/scripts/privacy.sh"
    #
    # To be complete, Safari->Preferences->AutoFill clear all of the checkmarks (it won't remember passwords and forms).
    # If you use 'Time Machine', you should exclude all of these folders, too.
    #
    # Script runs as root, so make sure this file is protected from casual modification.
    #

    if [ -z '$1' -o ! -d '/Users/$1' ] 
    then 
        useroot=~
    else
        useroot=/Users/$1
    fi

    # Clear Safari History (except for bookmarks).
    /usr/bin/find $useroot/Library/Safari/ -not -name Bookmarks.plist -execdir /bin/rm -rf \{\} \;

    # Forget cookies
    /bin/rm -f $useroot/Library/Cookies/*

    # Forget whatever this stuff is
    /bin/rm -rf $useroot/Library/Caches/com.apple.Safari

    # Forget Flash plugin persistent 'Shared Objects' settings 
    /bin/rm -rf $useroot/Library/Preferences/Macromedia/Flash\ Player/#SharedObjects

    # Forget another copy of history
    /bin/rm -rf $useroot/Library/Caches/Metadata/Safari/History

    # Forget search history embedded in Safari preferences
    /usr/bin/defaults write $useroot/Library/Preferences/com.apple.Safari RecentSearchStrings '( )'
    #defaults delete ~/Library/Preferences/com.apple.Safari RecentSearchStrings
    #/usr/bin/defaults write $useroot/Library/Preferences/com.apple.Safari RecentSearchStrings '( "None of your business." )'

    #Since we modified this as 'root', we need to give it back to the user, or we lose all settings.
    if test ! -z $1 ; then
        chown $1 $useroot/Library/Preferences/com.apple.Safari.* 
    fi

    # If only this worked...
    #defaults write ~/Library/Preferences/com.apple.Safari PrivateBrowsingEnabled 1

    # Add any additional clean-up here.
}<commit_msg>fix: clean_up_safari<commit_after>#!/bin/bash

clean_up_safari() {
    if [ -z '$1' -o ! -d '/Users/$1' ] 
    then 
        useroot=~
    else
        useroot=/Users/$1
    fi

    # Clear Safari History (except for bookmarks).
    /usr/bin/find $useroot/Library/Safari -mindepth 1 -maxdepth 1 -execdir /bin/rm -rf \{\} \;

    # Forget cookies
    /bin/rm -f $useroot/Library/Cookies/*

    # Forget whatever this stuff is
    /bin/rm -rf $useroot/Library/Caches/com.apple.Safari

    # Forget Flash plugin persistent 'Shared Objects' settings 
    /bin/rm -rf $useroot/Library/Preferences/Macromedia/Flash\ Player/#SharedObjects

    # Forget another copy of history
    /bin/rm -rf $useroot/Library/Caches/Metadata/Safari/History

    # Forget search history embedded in Safari preferences
    /usr/bin/defaults write $useroot/Library/Preferences/com.apple.Safari RecentSearchStrings '( )'

    #Since we modified this as 'root', we need to give it back to the user, or we lose all settings.
    if test ! -z $1 ; then
        chown $1 $useroot/Library/Preferences/com.apple.Safari.* 
    fi
}
{'fraction_non_alphanumeric': 0.11001317523056653, 'fraction_numerical': 0.004281949934123847, 'mean_word_length': 2.8153266331658293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '112424', 'n_tokens_mistral': 991, 'n_tokens_neox': 937, 'n_words': 286}