Commit 77cdbf20 authored by Murukesh Mohanan's avatar Murukesh Mohanan

Multilingual stuff, and JavaScript's back!

parent e451619b
...@@ -23,7 +23,7 @@ Or, alternatively: ...@@ -23,7 +23,7 @@ Or, alternatively:
---- ----
The site is written for Jekyll as used by Github Pages, and that is The site is written for Jekyll as used by Github Pages, and that is
installed on mars. The site is updated using: installed on mars. The site is updated on www.cse.iitb.ac.in using:
```sh ```sh
cd ~/devel/web && cd ~/devel/web &&
......
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
{% else %} {% else %}
{% assign pagestyle = layout.pagestyle %} {% assign pagestyle = layout.pagestyle %}
{% endif %} {% endif %}
{% if page.script %}
<script src="js/{{ page.script }}.js" type="text/javascript">
</script>
{% endif %}
{% if pagestyle %} {% if pagestyle %}
<link rel="stylesheet" href="{{ site.base-url }}/styles/{{ pagestyle }}.css" type="text/css"> <link rel="stylesheet" href="{{ site.base-url }}/styles/{{ pagestyle }}.css" type="text/css">
{% endif %} {% endif %}
......
...@@ -11,7 +11,7 @@ permalink: /cv/ ...@@ -11,7 +11,7 @@ permalink: /cv/
{:.org} {:.org}
<details markdown="1"> <details markdown="1">
- TBC - Tokyo, Japan
</details> </details>
<!-- section --> <!-- section -->
...@@ -37,6 +37,8 @@ Computer Science and Engineering ...@@ -37,6 +37,8 @@ Computer Science and Engineering
<details markdown="1"> <details markdown="1">
### Senior Application Developer ### Senior Application Developer
- Chennai, India
</details> </details>
<!-- section --> <!-- section -->
......
#! /usr/bin/python3
import sys
import csv
csvr = csv.reader(sys.stdin)
header = next(csvr)
indexheader = {v:i for i,v in enumerate(header)}
table = [[int(x) if not x[0].isalpha() else x for x in row] for row in csvr]
#for row in table:
# print(row)
count=0
print('<table id="cann-table">')
for pt in range(table[0][-1], table[-1][-1] - 1, -1):
clubs = [row[2] for row in table if row[-1] == pt]
label = '1' if count < 3 else '2'
count = (count + 1) % 6
print('\t<tr class="cann-row-' + label + '">')
print('\t\t<td class="cann-point">', pt, '</td>')
print('\t\t<td class="cann-clubs">')
for club in clubs:
print('\t\t\t<span class="club-name">', club, '</span>')
print('\t\t</td>\n', '\t</tr>')
print('</table>')
#! /bin/bash
# ↄ⃝ Murukesh Mohanan
# This scipt will use curl (assuming it's somehwhere in your $PATH) to download
# a file in pieces of 149 MB, or whatever size you specify (in MB).
# Unfortunately, there's not much support for arguments and switches to the
# script. The currently fixed order is (with default values):
# <target URL> [target directory = $PWD] [piece size in MB = 149]
# The intermediate pieces are stored in adirectory named ".tempdir" in the
# target directory, with the part number (starting from 0) appended to it.
# It so happens that the script will try to resume download using any ".0" part
# in that directory, since my string manipulation isn't that good. Sorry!
# You may modify it as you please, so long as you tell me what you did, so that
# I can make use of any improvements you made. :) Happy downloading!
function INT_cleanup()
{
kill `jobs -p`
exit
}
trap INT_cleanup INT
status=0
temp_dir=".tempdir"
if [ -z $1 ]; then
echo "Usage: "
echo "<script name> URL [Target Directory] [piece size in MB]"
echo "Please specify a URL to download, if you still wanna continue."
read download_URL
else
download_URL="$1"
fi
if [ -z $2 ]; then
working_dir="$PWD"
else
working_dir="$2"
fi
if [ -z $3 ]; then
piece_size=$((149*1024*1024))
else
piece_size=$(($3*1024*1024))
fi
cd $working_dir
file_size=$((`curl $download_URL -s -I -L | grep "200 OK" -A 10 | grep "Content-Length: " | grep '[0-9]*' -o`))
# There's nothing magical about the numbers 16 and 1, they're merely the lengths
# of "Content-Length: " and the "\r" characters at the end of the line
# returned by grep. Didn't make much sense making variables for them.
num_parts=$((file_size / piece_size))
part_size[$num_parts]=$((file_size % piece_size))
if [[ ! -d $temp_dir ]]; then
mkdir $temp_dir
fi
cd $temp_dir
for i in `seq 0 $((num_parts - 1))`; do
part_size[$i]=$((piece_size))
done
if ls | grep ".0" -q; then
file_name="$(ls *.0)"
file_name=${file_name%".0"}
else
curl --remote-name --silent $download_URL --range 0-0 --location
file_name="$(ls)"
part_name="`echo $file_name.0`"
mv $file_name -T "$part_name"
fi
while [ $status -eq 0 ]; do
loop_iterations=`expr $loop_iterations + 1`
for i in `seq 0 $num_parts`; do
part_name="`echo $file_name.$i`"
if [ -e "$part_name" ]; then
current_size=$(stat $part_name -c%s)
if [ $current_size -eq ${part_size[i]} ]; then
echo "Part $i done!"
continue
elif [ $current_size -ge ${part_size[i]} ]; then
echo "Something's wrong with part $i's size. Exiting..."
kill $(jobs -p)
exit
else
echo "Resuming part $i!"
fi
part_begin=$(( i*piece_size + current_size))
else
part_begin=$(( i*piece_size ))
fi
part_end=$((i*piece_size + part_size[i] - 1))
echo "Downloading part $i: From $part_begin till $part_end."
curl $download_URL --location --silent --range $part_begin-$part_end >> "$part_name" &
done
wait
echo "Any cURL processes I started have ended. Let me see if the files have been downloaded completely."
status=1
for i in `seq 0 $num_parts`; do
part_name="`echo $file_name.$i`"
current_size=$(stat $part_name -c%s)
if [ $((current_size - part_size[i])) -lt 0 ]; then
echo "In part $i, $(( part_size[i] - current_size )) bytes remain to be downloaded."
status=$((status && 0))
fi
done
if [ $loop_iterations -eq 10 ]; then
echo "Quiting the task. Something might be wrong, as this the tenth time"
echo "I've tried downloading. Do check what's going wrong. Sorry! :("
exit
fi
done
echo "All files done."
cd $working_dir
if ls | grep -q "$file_name"; then
current_size=$(stat $file_name -c%s)
if [ $((current_size - file_size)) -eq 0 ]; then
echo "A file of matching size and name already exists at the site."
fi
else
cat $temp_dir/$file_name.* > $file_name
downloaded_size=$(stat $file_name -c%s)
if [ $downloaded_size -eq $file_size ]; then
rm $temp_dir -r -f
echo "Done!"
else
echo "Oh, damn! Something's wrong. Better check the file size."
fi
fi
\ No newline at end of file
#! /bin/bash
# ↄ⃝ Murukesh Mohanan
# This script will mount the arguments as ISO9660 in subdirectory of ~/cdrom.
# Given no argument, it will clean up ~/cdrom and unmount any mounted ISOs.
ISODIR=$PWD
CDROOT=~/cdrom
if [ ! -d $CDROOT ]; then
mkdir -p $CDROOT
fi
COUNT=`/usr/bin/ls -1 --reverse $CDROOT/ | head -1`
#cd $CDROOT
for ISO in $@; do
let COUNT=$COUNT+1
mkdir $CDROOT/$COUNT
sudo mount -t iso9660 $ISO $CDROOT/$COUNT
if [[ $? -ne 0 ]]; then
rmdir $CDROOT/$COUNT
fi
done
if [[ $# -eq 0 ]]; then
cd $CDROOT
for i in `/usr/bin/ls`; do
sudo umount $i
rmdir $i
done
fi
\ No newline at end of file
#! /bin/bash
# ↄ⃝ Murukesh Mohanan
# This script asks the user for their LDAP username and password,
# and then sets up proxy variables in /etc/environment and /etc/apt/apt.conf.
# It also sets proxy variables in /etc/bash.bashrc, even though I think this
# is not needed. It also exports these variables for the current session.
# Then it proceeds to test them by updating APT.
#
# Optionally, it can install software for CS699 (and other courses - planned)
# and any updates in general.
# Copied from http://stackoverflow.com/questions/296536/urlencode-from-a-bash-script.
# Thanks, Orwellophile and Pumbaa80.
# This function encodes the input, (here the LDAP password), in a format suitable
# for use in a URL. There are other cleaner, quicker ways, but these have certain
# dependencies (such as curl or a certain sed script) which aren't available on a
# base Ubuntu desktop installation.
rawurlencode() {
local string="${1}"
local strlen=${#string}
local encoded=""
for (( pos=0 ; pos<strlen ; pos++ )); do
c=${string:$pos:1}
case "$c" in
[-_.~a-zA-Z0-9] ) o="${c}" ;;
* ) printf -v o '%%%02x' "'$c"
esac
encoded+="${o}"
done
echo "${encoded}" # You can either set a return variable (FASTER)
REPLY="${encoded}" #+or echo the result (EASIER)... or both... :p
}
# I need a temporary directory, for intermediate files.
# An MD5 hash of the username is pretty much certain to be not an existing
# directory. At the same time, it is constant, repeat runs won't create
# more directories. I could use /dev/random, but I'm too lazy to work out
# the problem of leftover directories from previous runs. :P
tmpdir=~/`echo $USER | md5sum | cut -d" " -f1`
# The LDAP password prompt is a password prompt (the -s), it doesn't
# show what is being typed.
read -p "Enter your LDAP ID: " LDAPID
read -sp "Enter your LDAP password: " LDAPPSWD
echo -e \n "Setting up proxy variables..."
# Only the password needs to be encoded now, since the username is almost
# certain to be safe. I'll have to examine the rules governing the username
# and maybe encode the username too.
LDAPENCPSWD=$( rawurlencode $LDAPPSWD )
export http_proxy="http://$LDAPID:$LDAPENCPSWD@netmon.iitb.ac.in:80"
export https_proxy=$http_proxy
# Create our working directory and copy the files here for modification.
mkdir -p $tmpdir
cd $tmpdir
cp /etc/environment .
cp /etc/bash.bashrc .
cp /etc/apt/sources.list .
# Delete existing proxy settings.
sed -i '/_proxy/d' environment bash.bashrc
echo http_proxy=$http_proxy >> environment
echo https_proxy=$https_proxy >> environment
echo export http_proxy=$http_proxy >> bash.bashrc
echo export https_proxy=$http_proxy >> bash.bashrc
# The <<"EOF" starts a here-doc, ended by the EOF on a line by itself.
# Note the quotes around EOF. Without the quotes, I could write the echos
# above as here-docs too.
cat > apt.conf <<"EOF"
Acquire::http::Proxy "http://printserver.cse.iitb.ac.in:3144/";
Acquire::http::Proxy::ftp.iitb.ac.in DEFAULT;
EOF
# I want backups of every file I'm overwriting.
alias cp='cp -b'
# I'll replace sources.list if it isn't using the IITB mirror, or
# if it is missing a few marbles. I should replace the checksum
# check with another.
REPLACE_SOURCES=0
# Guess where the checksum came from.
if echo "d088b801d5e15cc7a2d7dfba5fae7431 /etc/apt/sources.list" | md5sum -c --status ; then
echo "You seem to have a rather threadbare sources.list,
I'm replacing it with a fuller one."
REPLACE_SOURCES=1
echo "alias cp='cp -b'" >> bash.bashrc
elif grep -qv iitb /etc/apt/sources.list; then
echo "I'm replacing your sources.list with one using ftp.iitb.ac.in as the mirror."
REPLACE_SOURCES=1
fi
if [[ $REPLACE_SOURCES -ne 0 ]]; then
# This here-doc contains my lab computer's sources.list.
cat >sources.list <<"EOF"
# deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ dists/precise/main/binary-i386/
# deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ dists/precise/restricted/binary-i386/
# deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ precise main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise universe
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise multiverse
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-backports main restricted universe multiverse
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-security main restricted
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-security universe
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-security multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu precise main
# deb-src http://extras.ubuntu.com/ubuntu precise main
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-proposed restricted main multiverse universe
EOF
release=`lsb_release -c | cut -f2`
sed -i "s/precise/$release/g" sources.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo cp sources.list /etc/apt/
fi
# Overwrite the originals while keeping backups.
[[ -f /etc/apt/apt.conf ]] &&
sudo cp /etc/apt/apt.conf /etc/apt/apt.conf.bak ||
echo "No original apt.conf found."
sudo cp apt.conf /etc/apt/
[[ -f /etc/environment ]] &&
sudo cp /etc/environment /etc/environment.bak ||
echo "No original environment file found."
sudo cp environment bash.bashrc /etc
echo "Testing the settings by updating apt:"
echo "sudo apt-get update"
if sudo apt-get update >~/apt.log; then
echo "APT seems to working fine."
else
echo "Something went wrong. I'll exit without removing any temporary files."
echo "Check $tmpdir and ~/apt.log for details."
exit 1
fi
read -p "Install the CS699 requirements? [Y|n]" option
case $option in
[Nn]) echo "Very well."
;;
*) echo "Installing..."
echo "sudo apt-get install -y emacs css-mode python-mode emacs23-el php-elisp
gnuplot-mode ispell vim ctags vim-scripts vim-gnome gnuplot dia xfig
fig2ps mpg123 python-pygresql python3-postgresql python php5 php5-ldap
php5-pgsql subversion cscope cscope-el apache2 bison flex sharutils
inkscape eclipse eclipse-cdt avidemux audacity openssh-server
vnc4server xvnc4viewer abs-guide"
sudo apt-get install -y emacs css-mode python-mode emacs23-el php-elisp \
gnuplot-mode ispell vim ctags vim-scripts vim-gnome gnuplot dia xfig \
fig2ps mpg123 python-pygresql python3-postgresql python php5 php5-ldap \
php5-pgsql subversion cscope cscope-el apache2 bison flex sharutils \
inkscape eclipse eclipse-cdt avidemux audacity openssh-server \
vnc4server xvnc4viewer abs-guide
## TODO: Add texlive packages here.
;;
esac
read -p "Install updates? [Y|n]" option
case $option in
[Nn]) echo "Very well."
;;
*) echo "Upgrading..."
echo "sudo apt-get upgrade -y"
sudo apt-get upgrade -y
;;
esac
# Cleanup.
rm ~/apt.log
cd ~
rm -rf $tmpdir
echo "I suppose that's all. Farewell, Great Lord (or Lady, as the case may be)."
#! /bin/bash
function table_bbc () {
echo -n Pos.,Team,P,W,D,L,GD,Pts.
curl -s http://www.bbc.com/sport/football/tables?filter=competition-118996114 |
grep -E '<td class=.(position|team|played|won|drawn|lost|goal|points)' |
sed 's/<[^>]*>//g;s/No movement//' |
tr '\n' ' ' |
sed 's/ \+/ /g;s/\([a-z]\) \([A-Z]\)/\1:\2/g;s/[0-9]\+ [A-Z]/\n&/g;'
echo
}
# table_bbc | sed 's/ \+$//;s/ /,/g;s/:/ /'
function table_pl () {
curl -s "http://www.premierleague.com/en-gb/matchday/league-table.html" |
grep -E 'col-(pos|lp|club|[pwdl]|g[fad]|pts)' |
tr '\r\n()' ' ' |
sed 's/<[^>]*>//g;s/ \+/ /g;s/POS[A-Z ]*$//;s/[0-9]\+ [0-9]\+ [A-Z]/\n&/g;s/^ *//;s/\([a-z]\) \([A-Z]\)/\1:\2/g' |
sed 's/ *$//' |
tr ' ' ',' |
tr ':' ' '
echo
}
table_pl | ./cann-table.py
#! /bin/bash
# ↄ⃝ Murukesh Mohanan
# This script asks the user for their LDAP username and password,
# and then sets up proxy variables in /etc/environment and /etc/apt/apt.conf.
# It also sets proxy variables in /etc/bash.bashrc, even though I think this
# is not needed. It also exports these variables for the current session.
# Then it proceeds to test them by updating APT.
#
# Optionally, it can install software for CS699 (and other courses - planned)
# and any updates in general.
# Copied from http://stackoverflow.com/questions/296536/urlencode-from-a-bash-script.
# Thanks, Orwellophile and Pumbaa80.
# This function encodes the input, (here the LDAP password), in a format suitable
# for use in a URL. There are other cleaner, quicker ways, but these have certain
# dependencies (such as curl or a certain sed script) which aren't available on a
# base Ubuntu desktop installation.
rawurlencode() {
local string="${1}"
local strlen=${#string}
local encoded=""
for (( pos=0 ; pos<strlen ; pos++ )); do
c=${string:$pos:1}
case "$c" in
[-_.~a-zA-Z0-9] ) o="${c}" ;;
* ) printf -v o '%%%02x' "'$c"
esac
encoded+="${o}"
done
echo "${encoded}" # You can either set a return variable (FASTER)
REPLY="${encoded}" #+or echo the result (EASIER)... or both... :p
}
# I need a temporary directory, for intermediate files.
# An MD5 hash of the username is pretty much certain to be not an existing
# directory. At the same time, it is constant, repeat runs won't create
# more directories. I could use /dev/random, but I'm too lazy to work out
# the problem of leftover directories from previous runs. :P
tmpdir=~/`echo $USER | md5sum | cut -d" " -f1`
# The LDAP password prompt is a password prompt (the -s), it doesn't
# show what is being typed.
read -p "Enter your CSE ID: " LDAPID
read -sp "Enter your CSE password: " LDAPPSWD
echo -e \n "Setting up proxy variables..."
# Only the password needs to be encoded now, since the username is almost
# certain to be safe. I'll have to examine the rules governing the username
# and maybe encode the username too.
LDAPENCPSWD=$( rawurlencode $LDAPPSWD )
export http_proxy="http://$LDAPID:$LDAPENCPSWD@proxy.cse.iitb.ac.in:80"
export https_proxy=$http_proxy
# Create our working directory and copy the files here for modification.
mkdir -p $tmpdir
cd $tmpdir
cp /etc/environment .
cp /etc/apt/sources.list .
# Delete existing proxy settings.
sed -i '/_proxy/d' environment
echo http_proxy=$http_proxy >> environment
echo https_proxy=$https_proxy >> environment
echo export http_proxy=$http_proxy >> proxy-cse.sh
echo export https_proxy=$http_proxy >> proxy-cse.sh
release=$(lsb_release -sc)
# The <<"EOF" starts a here-doc, ended by the EOF on a line by itself.
# Note the quotes around EOF. Without the quotes, I could write the echos
# above as here-docs too.
#cat > apt.conf <<"EOF"
#Acquire::http::Proxy "http://printserver.cse.iitb.ac.in:3144/";
#Acquire::http::Proxy::ftp.iitb.ac.in DEFAULT;
#EOF
cat > apt.conf <<EOF
Acquire::http::Proxy "$http_proxy";
Acquire::http::Proxy::ftp.iitb.ac.in DEFAULT;
EOF
# I want backups of every file I'm overwriting.
#alias cp='cp -b'
# I'll replace sources.list if it isn't using the IITB mirror, or
# if it is missing a few marbles. I should replace the checksum
# check with another.
REPLACE_SOURCES=y
# Guess where the checksum came from.
read -p "Use IITB's Ubuntu mirror? [Y|n]" REPLACE_SOURCES
if [[ '[Yy]' =~ $REPLACE_SOURCES ]] ; then
echo "I'm replacing your sources.list with one using ftp.iitb.ac.in as the mirror."
# This here-doc contains my lab computer's sources.list.
cat >sources.list <<"EOF"
# deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ dists/precise/main/binary-i386/
# deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ dists/precise/restricted/binary-i386/
# deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ precise main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise universe
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise multiverse
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-backports main restricted universe multiverse
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-security main restricted
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-security universe
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-security multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu precise main
# deb-src http://extras.ubuntu.com/ubuntu precise main
deb ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ precise-proposed restricted main multiverse universe
EOF
release=$(lsb_release -sc)
sed -i "s/precise/$release/g" sources.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.cse
sudo cp sources.list /etc/apt/
fi
# Overwrite the originals while keeping backups.
sudo cp /etc/apt/apt.conf /etc/apt/apt.conf.cse
sudo cp apt.conf /etc/apt/
sudo cp /etc/environment /etc/environment.cse
sudo cp environment /etc/environment
sudo cp proxy-cse.sh /etc/profile.d
echo "Testing the settings by updating apt:"
echo "sudo apt-get update"
if sudo apt-get update >~/apt.log; then
echo "APT seems to working fine."
else
echo "Something went wrong. I'll exit without removing any temporary files."
echo "Check $tmpdir and ~/apt.log for details."
exit 1
fi
# Cleanup.
rm ~/apt.log
cd ~
rm -rf $tmpdir
cat - <<EOF
You can undo the changes using the following commands:
sudo cp /etc/environment.cse /etc/environment
sudo cp /etc/apt/apt.conf.cse /etc/apt/apt.conf
sudo cp /etc/apt/sources.list.cse /etc/sources.list.conf
sudo rm /etc/profile.d/proxy-cse.sh
Log out and log in again.
EOF
echo "I suppose that's all. Farewell, Great Lord (or Lady, as the case may be)."
--- ---
title: About Me title: About Me
pagestyle: index
script: index
--- ---
- {:#en .active} En
- {:#ml} മ
- {:#jp} 日
{:#i18n}
Call me Muru. Call me Muru.
{:.en .active}
私は ムルケシュ モハナン です。
ムルーと 呼んで ください。
どうぞ よろしく おねがいします。
二千十六年七月から 日本語を ならった います。
{:.jp .inactive}
എന്റെ പേര മുരുകെഷ് ആണു.
എന്നെ മുരു എന്നു വിളിക്കുക.
മലയാളി ആണെങ്കിലും വളര്‍നതു ബോംബെയില്‍ ആണു.
{:.ml .inactive}
I know English, മലയാളം (Malayalam), हिंदी (Hindi), and a smattering of 日本語 (Japanese) and मराठी (Marathi).
<!-- section --> <!-- section -->
......
(
function(m) {
var currentButton = 'en';
var swapClass = function (classList, del, add) {
}
m.SwitchTo = function (id) {
if (id == currentButton) {
return;
}
var next_el = document.getElementById(id);
var curr_el = document.getElementById(currentButton);
next_el.className = 'active';
curr_el.className = 'inactive';
to_hide = document.getElementsByClassName(currentButton);
to_show = document.getElementsByClassName(id);
Array.prototype.forEach.call(to_hide, function(elem){
elem.classList.remove('active');
elem.classList.add('inactive');
});
Array.prototype.forEach.call(to_show, function(elem){
elem.classList.remove('inactive');
elem.classList.add('active');
});
currentButton = id;
};
window.onload = function () {
document.getElementById('i18n').childNodes.forEach(
function(elem) {
if (elem.tagName == "LI") {
console.log(elem.id);
elem.onclick = function() {
m.SwitchTo(elem.id);
};
}
}
);
};
}(window.M = window.M || {})
);
ul#i18n li {
display: inline-block;
list-style: none;
width: 3em;
font-size: 0.7em;
background-color: #505050;
text-align: center;
margin-left: 0;
border: 0.05em solid #555555;
}
#i18n {
border-radius: 0.2em;
overflow: hidden;
display: flex;
float: right;
box-shadow: inset 0 0 0.1em 0.1em rgba(128,128,128,0.75);
}
#i18n li.active {
box-shadow: 0 0 0.1em 0.1em rgba(16,16,16,0.85);
background-color: #606060;
z-index: 1000;
border-radius: 0.1em;
border: 0.1em solid #555555;
}
.active {
display: initial;
}
.inactive {
display: none;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment