diff --git a/README.mkdn b/README.mkdn index e723d1e..6bb615a 100644 --- a/README.mkdn +++ b/README.mkdn @@ -1,4 +1,4 @@ -Swordrune10's Debian/Ubuntu Scripts +Swordrune10's Chrome OS Scripts ------------------------- diff --git a/android/moto-fastboot b/android/moto-fastboot deleted file mode 100755 index a8ca486..0000000 Binary files a/android/moto-fastboot and /dev/null differ diff --git a/app/addpkg b/app/addpkg deleted file mode 100755 index 310e501..0000000 --- a/app/addpkg +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# Copyright (C) 2014 Sean Donovan - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -sudo apt-get install $@ diff --git a/app/addrepo b/app/addrepo deleted file mode 100755 index 4f2cb18..0000000 --- a/app/addrepo +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# Copyright (C) 2014 Sean Donovan - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -sudo add-apt-repository "$@" diff --git a/app/avconvchromecast b/app/avconvchromecast deleted file mode 100755 index 8260837..0000000 --- a/app/avconvchromecast +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# Copyright (C) 2014 Sean Donovan - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -SAVEIFS=$IFS -IFS=$(echo -en "\n\b") -for f in `echo .3gp` `echo .asf` `echo .asx` `echo .avi` `echo .divx` `echo .dvx` `echo .flv` `echo .h264` `echo .m2ts` \ -`echo .m4v` `echo .mkv` `echo .mov` `echo .mp4` `echo .mpeg` `echo .mts` `echo .ogm` `echo .rm` `echo .rmvb` `echo .swf` \ -`echo .wm` `echo .wmv` `echo .xvid` `echo .yuv` -do - for video in `find . -print | grep "$f"` - do - if ( ! avprobe "$video" |& grep "No such file or directory" &> /dev/null ) \ - || ( avprobe "$video" |& grep "Video:" &> /dev/null ); then - if ( avprobe "$video" |& grep "Video: h264" &> /dev/null ) \ - && ( avprobe "$video" |& grep "Audio: aac" &> /dev/null ); then - echo "$video's video format is compatible" - else - echo "$video's video format is not compatible" - fi - fi - done -# find . -type f -name "*.flac" -exec bash -c 'avconv -i "$0" -c:a alac "${0/%flac/m4a}"' '{}' \; -done diff --git a/app/mkdvd b/app/mkdvd deleted file mode 100755 index 69c92f0..0000000 --- a/app/mkdvd +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -# Copyright (C) 2014 Sean Donovan - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -echo "Checking if prerequisites are installed" -for f in `echo mplayer` `echo movie-to-dvd` `echo dvdauthor` `echo genisoimage` `echo libxvidcore4` -do - if [ $f == "libxvidcore4" ]; then - if ( ! locate libxvidcore4 &> /dev/null ); then - needsinstall="$needsinstall $f" - fi - elif ( ! type -a $f &> /dev/null ); then - if [ $f == "movie-to-dvd" ]; then - f="videotrans" - fi - needsinstall="$needsinstall $f" - fi -done - -if [ ! "$needsinstall" ]; then - echo "All prerequisites are already installed" -else - echo "Some prerequisites needs to be installed" - sudo apt-get install $needsinstall -fi - -videostandard () { -echo "Is this dvd going to be NTSC or PAL?" -read videostandard - -if [ $videostandard == "NTSC" ] || [ $videostandard == "ntsc" ]; then - export VIDEO_FORMAT=NTSC - movietodvdstandard=ntsc -elif [ $videostandard == "PAL" ] || [ $videostandard == "pal" ]; then - export VIDEO_FORMAT=PAL - movietodvdstandard=pal -else - echo "You did not type in the correct response! try again.." - echo "" - videostandard -fi -} -videostandard - -echo "Where is the video that is being converted at exactly?" -echo "Example: If it is in your home folder it will be at $HOME" -read whereisvideo - -echo "What is the name of the video file? please include extension" -echo "Example: i_am_a_valid_video_file.mp4" -read moviefile - -mkdir -p "$whereisvideo"/temp -cd "$whereisvideo"/temp - -movietitle=$(echo "$moviefile" | sed s/\.[^\.]*$//) - -movie-to-dvd -m $movietodvdstandard -o . ../"$moviefile" - -mplex -f 8 -o "$movietitle".mpg "$movietitle".m2v "$movietitle".ac3 - -dvdauthor -o dvd/ -t "$movietitle".mpg - -dvdauthor -o dvd/ -T -genisoimage -dvd-video -v -o ../"$movietitle".iso dvd -cd .. -rm -r temp diff --git a/app/removerepo b/app/removerepo deleted file mode 100755 index 7177855..0000000 --- a/app/removerepo +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# Copyright (C) 2014 Sean Donovan - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -sudo add-apt-repository --remove "$@" diff --git a/app/torrentmaker b/app/torrentmaker index 85102f6..48f9769 100755 --- a/app/torrentmaker +++ b/app/torrentmaker @@ -23,7 +23,7 @@ if [ ! "$needsinstall" ]; then echo "All prerequisites are already installed" else echo "A prerequisites needs to be installed" - sudo apt-get install $needsinstall + sudo yum install $needsinstall fi echo "You want to make a webseeder?" diff --git a/app/update b/app/update deleted file mode 100755 index 3ffe4e6..0000000 --- a/app/update +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Copyright (C) 2014 Sean Donovan - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -sudo apt-get update -sudo apt-get --allow-unauthenticated dist-upgrade -sudo apt-get autoclean -sudo apt-get autoremove diff --git a/server/limitbandwidth b/server/limitbandwidth deleted file mode 100755 index b953249..0000000 --- a/server/limitbandwidth +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# Copyright (C) 2014 Sean Donovan - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -echo "Checking if prerequisites are installed" - -if ( ! type -a wondershaper &> /dev/null ); then - needsinstall="wondershaper" -fi - -if [ ! "$needsinstall" ]; then - echo "All prerequisites are already installed" -else - echo "A prerequisites needs to be installed" - sudo apt-get install $needsinstall -fi - -if [ "$1" == "clear" ]; then - sudo wondershaper clear eth0 -else - echo "How much Mbps would you like to be able to be downloaded?" - read downlimit - echo "How much Mbps would you like to be able to be uploaded?" - read uplimit - - sudo wondershaper eth0 $(( $downlimit * 1024 )) $(( $uplimit * 1024 )) - echo "The limit of bandwidth of $downlimit Mbps and $uplimit Mpbs has been done" -fi diff --git a/server/nitenite b/server/nitenite index ab8598a..3b8a515 100755 --- a/server/nitenite +++ b/server/nitenite @@ -14,19 +14,16 @@ # limitations under the License. main() { -clear -cd ~ echo "How long would you like the computer to sleep for?" echo "Type list to see a list of units of time supported" echo "Type exit to leave program" echo "Example = 10 hours" read decision -#if what was typed had any upper case letters convert it -#to lower case into another file and then rewrite the -#variable with the modification +#if what was typed had any upper case letters convert it +#to lower case -if ( echo $decision | grep -q [A-Z] );then +if ( echo $decision | grep -q [A-Z] );then decision=$(echo $decision | sed -e 's/\(.*\)/\L\1/') fi @@ -37,15 +34,14 @@ length=$(echo $decision | sed 's/[^a-z]*//g') #exit if; quit program immediately if told to do so, easy way to work on this script -if [ $length == "exit" ]; then - clear +if [ "$length" == "exit" ]; then echo "Program Terminated" exit 0 fi #list if; type list and u get all the units in a list! amazing! -if [ $length == "list" ]; then +if [ "$length" == "list" ]; then echo "" echo "All supported units of time is:" echo "seconds, minutes, hours, days, weeks, fortnights," @@ -55,8 +51,7 @@ if [ $length == "list" ]; then fi #this checks to see if what was typed had any numbers in -#it, and if it doesnt the script will delete all unnecessary files -#and terminate early +#it, and if it doesnt the script will start over if ( ! echo $time | grep -q [0-9]); then echo "" @@ -65,8 +60,8 @@ if ( ! echo $time | grep -q [0-9]); then main fi -#the beginning of all the if statements to figure out how to calculate the results, -#it uses the unit of time specified to determine the length of the +#the beginning of all the if statements to figure out how to calculate the results, +#it uses the unit of time specified to determine the length of the #effect the user wants #seconds if; easy @@ -113,7 +108,7 @@ if [ $length == "month" ] || [ $length == "months" ]; then fi #years if; because of the calculated disaster of months i had to use the only -#one that wasnt a decimal, which is ironically the actual answer of seconds +#one that wasnt a decimal, which is ironically the actual answer of seconds #there is in a year x.x #after this it will go back to just multiplying from this diff --git a/server/restartapache b/server/restartapache deleted file mode 100755 index dde5a28..0000000 --- a/server/restartapache +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# Copyright (C) 2014 Sean Donovan - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -sudo /etc/init.d/apache2 restart diff --git a/server/ubuonestop b/server/ubuonestop deleted file mode 100755 index f90b36a..0000000 --- a/server/ubuonestop +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# Copyright (C) 2014 Sean Donovan - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -u1sdtool --quit diff --git a/server/ubuonesync b/server/ubuonesync deleted file mode 100755 index 00f1786..0000000 --- a/server/ubuonesync +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# Copyright (C) 2014 Sean Donovan - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -watch -n .1 u1sdtool --current-transfers diff --git a/server/updatetime b/server/updatetime deleted file mode 100755 index c3517ba..0000000 --- a/server/updatetime +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Copyright (C) 2014 Sean Donovan - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -sudo /etc/init.d/ntp stop -# dallas texas server -sudo ntpdate -u ntp.jentfoo.com -sudo /etc/init.d/ntp start diff --git a/setupbin b/setupbin index 325dfd5..fa8ca1a 100755 --- a/setupbin +++ b/setupbin @@ -13,14 +13,26 @@ # See the License for the specific language governing permissions and # limitations under the License. -cd ~ -if ( grep -q HOME/bin/android .profile );then - echo ".profile doesn't need to be patched" -fi -if ( ! grep -q HOME/bin/android .profile ) && ( find $HOME/bin/private &> /dev/null );then - sed -i '/PATH"/ a\ PATH="$HOME/bin/android:$HOME/bin/app:$HOME/bin/private:$HOME/bin/server:$PATH"' .profile - echo "patched .profile" +if ( grep -q HOME/bin/android $HOME/.bash_profile ); then + echo ".bash_profile doesn't need to be patched" else - sed -i '/PATH"/ a\ PATH="$HOME/bin/android:$HOME/bin/app:$HOME/bin/server:$PATH"' .profile - echo "patched .profile" + +cat << EOF >> ~/.bash_profile + +# set PATH so it includes user's private bin if it exists +if [ -d "\$HOME/bin" ] ; then + PATH="\$HOME/bin:\$PATH" + PATH="\$HOME/bin/app:\$HOME/bin/server:\$PATH" +fi + +# set HOME as executable +sudo mount -io remount,exec ~ +EOF + +echo "patched .bash_profile" +fi + +if ( ! grep -q HOME/bin/private $HOME/.bash_profile ) && ( find $HOME/bin/private &> /dev/null ); then + sed -i '/PATH="$HOME\/bin\/android/ a\ PATH="$HOME/bin/private:$PATH"' $HOME/.bash_profile + echo "patched .bash_profile to include private" fi diff --git a/app/removepkg b/unsetbin similarity index 72% rename from app/removepkg rename to unsetbin index 400be4d..3e0578d 100755 --- a/app/removepkg +++ b/unsetbin @@ -13,4 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -sudo apt-get remove $@ +cat << EOF > ~/.bash_profile +# /etc/skel/.bash_profile + +# This file is sourced by bash for login shells. The following line +# runs your .bashrc and is recommended by the bash info pages. +[[ -f ~/.bashrc ]] && . ~/.bashrc +EOF diff --git a/updatebin b/updatebin index f1dde50..06891a6 100755 --- a/updatebin +++ b/updatebin @@ -13,5 +13,73 @@ # See the License for the specific language governing permissions and # limitations under the License. -cd $(dirname $( readlink -f $0 ) ) -git pull +github=$( echo "wget -Nq https://raw.githubusercontent.com/TeamKeyblade/bin_scripts/chromeos" ) +grepopt=$( echo '2>&1 | grep retrieving' ) + +cd ~ +mkdir -p bin +cd bin + +echo "Grabbing bin folder items" +echo "Grabbing LICENSE file.." +$github/LICENSE $grepopt +echo "Grabbing NOTICE file.." +$github/NOTICE $grepopt +echo "Grabbing README.mkdn file.." +$github/README.mkdn $grepopt +echo "Grabbing repo file.." +$github/repo $grepopt +chmod +x repo +echo "Grabbing setupbin file.." +$github/setupbin $grepopt +chmod +x setupbin +echo "Grabbing unsetbin file.." +$github/unsetbin $grepopt +chmod +x unsetbin +echo "Grabbing updatebin file.." +$github/updatebin $grepopt +chmod +x updatebin +echo "Finished bin folder items" + +echo "" + +mkdir -p app +cd app + +echo "Grabbing app folder items" +echo "Grabbing gitsubmit file.." +$github/app/gitsubmit $grepopt +chmod +x gitsubmit +echo "Grabbing mountmtp file.." +$github/app/mountmtp $grepopt +chmod +x mountmtp +echo "Grabbing torrentmaker file.." +$github/app/torrentmaker $grepopt +chmod +x torrentmaker +echo "Grabbing umountmtp file.." +$github/app/umountmtp $grepopt +chmod +x umountmtp +echo "Finished app folder items" + +echo "" + +mkdir -p ../server +cd ../server + +echo "Grabbing server folder items" +echo "Grabbing dropboxstatus file.." +$github/server/dropboxstatus $grepopt +chmod +x dropboxstatus +echo "Grabbing killback file.." +$github/server/killback $grepopt +chmod +x killback +echo "Grabbing nitenite file.." +$github/server/nitenite $grepopt +chmod +x nitenite +echo "Grabbing rmdropbox file.." +$github/server/rmdropbox $grepopt +chmod +x rmdropbox +echo "Grabbing setupdropbox file.." +$github/server/setupdropbox $grepopt +chmod +x setupdropbox +echo "Finished server folder items"