<commit_before>#!/bin/bash
# @Script set_proxy.sh
# @Author <NAME>
# @Purpose To automate setting up proxy
# @Usage ./set_proxy.sh
# Copyright (c) 2013 <NAME>
# Permission to copy and modify is granted under MIT License

echo When any file opens, paste the clipboard content and save before closing gedit.
echo -n Enter proxy:
read proxy
echo -n Enter port:
read port
read -p "Authorization required? [Y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
    echo -n Enter username:
    read user
    echo -n Enter password:
    read pass
    p=$user:$pass@$proxy:$port
else
    p=$proxy:$port
fi

sudo http_proxy=http://$p apt-get update
sudo http_proxy=http://$p apt-get install xclip

echo -e -n "
export http_proxy=http://$p
export https_proxy=http://$p
export ftp_proxy=http://$p
" | xclip -sel clip
sudo gedit /etc/bash.bashrc

echo -e -n "
Acquire::http::proxy \"http://$p\";
Acquire::https::proxy \"http://$p\";
Acquire::ftp::proxy \"http://$p\";
Acquire::http::No-Cache \"True\";
" | xclip -sel clip
sudo gedit /etc/apt/apt.conf

echo -e -n "
http_proxy=http://$p
https_proxy=https://$p
ftp_proxy=ftp://$p
" | xclip -sel clip
sudo gedit /etc/wgetrc
<commit_msg>Check if xclip is previously installed<commit_after>#!/bin/bash
# @Script set_proxy.sh
# @Author <NAME>
# @Purpose To automate setting up proxy
# @Usage ./set_proxy.sh
# Copyright (c) 2013 <NAME>
# Permission to copy and modify is granted under MIT License

echo When any file opens, paste the clipboard content and save before closing gedit.
echo -n Enter proxy:
read proxy
echo -n Enter port:
read port
read -p "Authorization required? [Y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
    echo -n Enter username:
    read user
    echo -n Enter password:
    read pass
    p=$user:$pass@$proxy:$port
else
    p=$proxy:$port
fi

if [ $(dpkg-query -W -f='${Status}' xclip | grep -c "install ok installed") -eq 0 ];
then
    sudo http_proxy=http://$p apt-get update
    sudo http_proxy=http://$p apt-get install xclip
fi

echo -e -n "
export http_proxy=http://$p
export https_proxy=http://$p
export ftp_proxy=http://$p
" | xclip -sel clip
sudo gedit /etc/bash.bashrc

echo -e -n "
Acquire::http::proxy \"http://$p\";
Acquire::https::proxy \"http://$p\";
Acquire::ftp::proxy \"http://$p\";
Acquire::http::No-Cache \"True\";
" | xclip -sel clip
sudo gedit /etc/apt/apt.conf

echo -e -n "
http_proxy=http://$p
https_proxy=https://$p
ftp_proxy=ftp://$p
" | xclip -sel clip
sudo gedit /etc/wgetrc

{'fraction_non_alphanumeric': 0.16016260162601625, 'fraction_numerical': 0.004471544715447155, 'mean_word_length': 3.6259398496240602, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '4848926', 'n_tokens_mistral': 936, 'n_tokens_neox': 891, 'n_words': 289}