Skip to main content

உபுண்டுவில் மென்பொருட்களை வேகமாக நிறுவ நிரல்

உபுண்டுவில் மென்பொருட்களை நிறுவ வேண்டும் என்றால் நாம் software center சென்று நிறுவுவோம். அப்பொது அதன் தரவிறங்கும் நேரம் சற்று அதிகமாகும். டெர்மினலில் apt-get மூலம் மென்பொருட்களை நிறுவினால் அது wget மூலம் பேக்கேஜ்களை தரவிறக்கி நம்முடைய கணினியில் நிறுவும்.

இதற்கு பதிலாக axel, prozilla, aria2c போன்ற download acceleratorகளை பயன்படுத்தி தரவிறக்கினோம் என்றால் இன்னும் சற்று அதிகமான வேகத்தில் தரவிறக்க முடியும். இந்த download acceleratorகள் parallel download எனும் முறையை பயன்படுத்து ஒரே fileஇனை பல்வேறு பகுதிகளாக பிரித்து தரவிறக்கி பிறகு சேர்க்கும் எனவே இவை சாதாரண டவுண்லோட் மேனேஜரை காட்டிலும் வேகமாக இருக்கும். இந்த script நம்முடைய apt-get
repositoryஇனை wget பதிலாக axel கொண்டு தரவிறக்குமாறு எழுதப்பட்டுள்ளது.

இதனை உபயோகிக்கும் முன் நமது கணினியில் axel அல்லது aria2c இருக்க வேண்டும். (இல்லை என்றாலும் script runசெய்யும் போது தானாக நிறுவிடும்) அதற்கு

axel நிறுவ:

$sudo apt-get install axel

aria2c நிறுவ:

$sudo apt-get install aria2c

என்று டெர்மினலில் தரவும்.

பிறகு கீழே உள்ள scriptஐ காபி செய்து apt-fast எனும் பெயரில் சேமிக்கவும். பிறகு அதனை /us/bin க்கு கொண்டு செல்ல வேண்டும்.

$sudo mv apt-fast /usr/bin/apt-fast

அடுத்து அதற்கு execute permission தர

$sudo chmod +x /usr/bin/apt-fast

apt-get கொண்டு என்னென்ன செய்ய முடியுமோ அனைத்தையும் apt-fastல் செய்யலாம்.
உதாரணத்திற்கு firefox நிறுவ

$sudo apt-fast install firefox

அல்லது upgrade செய்ய

$sudo apt-fast upgrade

githubலிருந்து கோடினை தரவிறக்கிகொள்ளவும்.

https://github.com/ilikenwf/apt-fast

விருப்பமான download managerஐ தேர்ந்தெடுக்க அதனை uncomment செய்யவும். axelஐ தேர்ந்தெடுக்க அதன் முன் உள்ள # symbolஐ எடுத்துவிடவும் அவ்வளவுதான்.

# !/bin/sh
# apt-fast v1.4 by Matt Parnell http://www.mattparnell.com, GNU GPLv3
# Use this just like apt-get for faster package downloading.

###################################################################
# CONFIGURATION OPTIONS #
###################################################################

# Maximum number of connections
_MAXNUM=5

# Note that the download manager you choose has other options - feel free
# to setup your own _DOWNLOADER line or customize one of the ones below...
# they're simply there for example purposes, and to provide sane defaults

# Download manager selection (choose one by uncommenting one #_DOWNLOADER line)

# aria2c:
#_DOWNLOADER='aria2c -c -j ${_MAXNUM} --input-file=/tmp/apt-fast.list --connect-timeout=600 --timeout=600 -m0'

# aria2c with a proxy (set username, proxy, ip and password!)
#_DOWNLOADER='aria2c -s 20 -j ${_MAXNUM} --http-proxy=http://username:password@proxy_ip:proxy_port -i apt-fast.list'

# axel:
#_DOWNLOADER='cat /tmp/apt-fast.list | xargs -l1 axel -n ${_MAXNUM} -a' # axel

###################################################################
# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING! #
###################################################################

_unlock() {
rm -f $LCK_FILE
}

# Check for proper priveliges
[ "`whoami`" = root ] || exec sudo "$0" "$@"

# Define our lock location
LCK_FILE=/var/lock/apt-fast.lck

lockfile-create -r 0 -q -l "${LCK_FILE}" || {
echo "Either you stopped apt-fast in the middle of work or it's already running."
echo "If you think apt-fast isn't running, you may delete /var/lock/apt-fast.lck and try again."
exit 100
}

trap " [ -f ${LCK_FILE} ] && _unlock" 0 1 2 3 13 15

# Make sure one of the download managers is enabled
[ -z "$_DOWNLOADER" ] && echo "You must configure apt-fast to use axel or aria2c" && _unlock && exit 1;

# If the user entered arguments contain upgrade, install, or dist-upgrade
if echo "$@" | grep -q "upgrade\|install\|dist-upgrade"; then
  echo "Working...";

  # Go into the directory apt-get normally puts downloaded packages
  cd /var/cache/apt/archives/;

  # Have apt-get print the information, including the URI's to the packages
  # Strip out the URI's, and download the packages with Axel for speediness
  # I found this regex elsewhere, showing how to manually strip package URI's you may need...thanks to whoever wrote it
  apt-get -y --print-uris $@ | egrep -o -e "(ht|f)tp://[^\']+" > /tmp/apt-fast.list
eval ${_DOWNLOADER}
  
# Install our downloaded packages
  apt-get $@;

  echo -e "\nDone! Verify that all packages were installed successfully. If errors are found, run apt-get clean as root and try again using apt-get directly.\n";

else
   apt-get $@;
fi

# Remove our lock

_unlock


Comments

Popular posts from this blog

ARP/RARP full simulation program

server.c #include "stdio.h" #include "stdlib.h" #include "string.h" #include "sys/types.h" #include "sys/socket.h" #include "arpa/inet.h" #include "netinet/in.h" #define SA struct sockaddr struct IPmac { char ip[100]; char mac[100]; }; int main() { int sockfd,len,i; struct sockaddr_in servaddr; char buff[30],temp[30],ip[30],mac[30];

Configure opendns in ubuntu 12.04

Today i have changed my dns server name to opendns. which is alternative to default dns and it provide more secure, faster browsing experience. What is opendns? OpenDNS is the leading provider of Internet security and DNS services Industry leading malware and botnet protection Award winning Web filtering Faster, reliable, more secure DNS Ultra-reliable, globally distributed cloud network Simple, Smart, Easy How to configure opendns in ubuntu 12.04: open terminal and type sudo nano /etc/resolv.conf enter your password and change these lines   nameserver 208.67.222.222  nameserver 208.67.220.220 to use google public dns use 8.8.8.8, 8.8.4.4 instead of 208.67.222.222, 208.67.220.220 simple isn't..! now see your facebook load faster than before. opendns comes with parental control, so never worry about unwanted websites, and your childrens are safe now. to check your dns changed successfully goto welcome.opendns.com

Given a string, reverse only vowels in it; leaving rest of the string as it is

/* Given a string, reverse only vowels in it; leaving rest of the string as it is. Input : abcdef Output : ebcdaf */ import java.io.*; import java.util.*; public class VowelReverse { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); String vowels = ""; String ans = ""; int arr[] = new int[str.length()]; for(int i=0;i<str.length();i++) { if(str.charAt(i)=='a' || str.charAt(i)=='e' || str.charAt(i)=='i' || str.charAt(i)=='o' || str.charAt(i)=='u') { vowels+=str.charAt(i); arr[i]=1; } } String revVowels = new StringBuffer(vowels).reverse().toString(); int j=0; for(int i=0;i<str.length();i++) { if(arr[i]!=1) { ans+=str.charAt(i); } else { ans+=revVowels.charAt(j); j++; } } System.out.println(ans); } }