Total upload and download on any interface.

Something that I have been searching for a long time, finally some look inside the /proc got me what I wanted. Hope this will save someone’s day. So far, the only option I could think of was to run conky which becomes a little heave on some of the very old laptops I have to use sometimes 🙁

1
 cat /proc/net/dev|grep eth2|awk '{print $2/1024/1024"  "$10/1024/1024}'

Enhanced by Zemanta

All in one solution for all the scripts of vim from vim.org

For quite sometime now, I was looking for some console based program which would help me get the scripts from vim.org. A simple solution would have been to do a wget for the scripts. But since there are so many scripts coming up daily and with a need to search based on script ID and name of the script, I thought better to write a script that can do all of those things. Now, what was required was that the script should be either able to download this or add to the GLVS script. Also note that, I had done something similar in the past here. There are some additions in the below script. You can download a copy of the script get_vim_scripts. Or you can copy the script from below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#!/bin/bash -
#===============================================================================
#
#          FILE:  get_scripts.sh
#
#         USAGE:  ./get_scripts.sh
#
#   DESCRIPTION:  Script to get the required vim script from the http
#                   server vim.org
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR:  Amit Agarwal (AKA), [email protected]
#       COMPANY:  Individual
#       VERSION:  1.0
#       CREATED:  01/06/2010 10:06:27 PM IST
#      REVISION: Wed 24 Mar 2010 10:50:37 PM IST
#===============================================================================

#-------------------------------------------------------------------------------
#   You mostly would not need to change the below params also,
#   but just in case you do not like to see my name or do
#   not like the location for these files, then you can change the name of
#   files in the below variables.
#
#   As a side note, it is good idea to keep them in location where they are
#   not deleted automatically so that the same can be used over and over
#   again, without downloading them.
#-------------------------------------------------------------------------------

tmp_file="/tmp/vim_scripts.html"
script_id_file="/tmp/script_id"

##========Do not change below this line...======

#===  FUNCTION  ================================================================
#          NAME:  download_list
#   DESCRIPTION:  Download the list of vim scripts and put it in a file.
#    PARAMETERS:  NA
#       RETURNS:  NA
#===============================================================================
download_list()
{
downloaded=1
if [ ! -f $tmp_file ]
then
wget -O $tmp_file 'http://www.vim.org/scripts/script_search_results.php?&show_me=4000&result_ptr=0' -o /dev/null
else
echo "using the existing $tmp_file"
fi
}

#===  FUNCTION  ================================================================
#          NAME:  get_list
#   DESCRIPTION:  Get the list of scripts from the vim.sf.net
#    PARAMETERS:  None
#       RETURNS:  Nothing
#===============================================================================
search_list ()
{

read -p "Enter the text to search :: " text
pager_exist=$(which $PAGER 2>/dev/null)
if [ "$pager_exist" = "" ]
then
echo "No pager defined that can be used, displaying the first 10 entries"
cat $tmp_file | grep width| grep script_id= |sed 's/.*script_id=//'|tr -d "\""|tr ">" " "|sed 's/<.*//' | tr -d '\001'-'\011''\013''\014''\016'-'\037''\200'-'\377' |grep -i "$text"
else
if [ "x$1" = "x" ]
then
cat $tmp_file | grep width| grep script_id= |sed 's/.*script_id=//'|tr -d "\""|tr ">" " "|sed 's/<.*//' | tr -d '\001'-'\011''\013''\014''\016'-'\037''\200'-'\377' |grep -i "$text"|$PAGER
else
cat $tmp_file | grep width| grep script_id= |sed 's/.*script_id=//'|tr -d "\""|tr ">" " "|sed 's/<.*//' | tr -d '\001'-'\011''\013''\014''\016'-'\037''\200'-'\377' |grep -i "$text"|$PAGER
fi
fi
echo "--$1--"

}
get_all_list()
{
echo "Printing the list of the scripts with the script ID's"
pager_exist=$(which $PAGER 2>/dev/null)
if [ "$pager_exist" = "" ]
then
echo "No pager defined that can be used, displaying the first 10 entries"
cat $tmp_file | grep width| grep script_id= |sed 's/.*script_id=//'|tr -d "\""|tr ">" " "|sed 's/<.*//' | tr -d '\001'-'\011''\013''\014''\016'-'\037''\200'-'\377' |sort -n|head -n 10
else
if [ "x$1" = "x" ]
then
cat $tmp_file | grep width| grep script_id= |sed 's/.*script_id=//'|tr -d "\""|tr ">" " "|sed 's/<.*//' | tr -d '\001'-'\011''\013''\014''\016'-'\037''\200'-'\377' |sort -n|$PAGER
else
cat $tmp_file | grep width| grep script_id= |sed 's/.*script_id=//'|tr -d "\""|tr ">" " "|sed 's/<.*//' | tr -d '\001'-'\011''\013''\014''\016'-'\037''\200'-'\377' |$PAGER
fi
fi
echo "--$1--"

}

#===  FUNCTION  ================================================================
#          NAME:  get_details
#   DESCRIPTION:  Get the details of the Sript ID
#    PARAMETERS:  NA
#       RETURNS:  NA
#===============================================================================
get_details()
{
echo -n "Enter the script ID to get the details :"
read script_id
if [ ! -f $script_id_file$script_id ]
then
wget -o /dev/null -O $script_id_file$script_id 'http://www.vim.org/scripts/script.php?script_id='$script_id |html2text
fi
printf "%20s"
printf "%20s\n\n\n" "+"|tr ' ' '+'

h2t=`which html2text 2>/dev/null`
if [ $h2t = "" ]
then
cat $script_id_file$script_id|sed --silent '/description/,/\/table/ p'
else
cat $script_id_file$script_id|sed --silent '/description/,/\/table/ p'|html2text
fi
printf "%20s"
printf "%20s\n\n\n" "+"|tr ' ' '+'
}

#===  FUNCTION  ================================================================
#          NAME:  print_header
#   DESCRIPTION:  Print the header for the script
#    PARAMETERS:  NA
#       RETURNS:  NA
#===============================================================================
print_header()
{
printf "\n\n\n%80s\n" "="|tr ' ' '='
echo "        Welcome to VIM Scripts utility"
echo "        Script written by Amit Agarwal"
echo "        http://blog.amit-agarwal.co.in"
printf "%80s\n" "="|tr ' ' '='

cat << EOF
Menu
====
1. Get the list of all scripts
2. Get the description for the script
3. Download the script
4. Add the script to GetVIMLatestScript
5. Get selective list for scripts
6. Delete the existing list of all scripts
7. Get the list of all scripts in reverse order
8. Search the plugin list.
p. Change Pager
q. Quit the script
----------------------------------------------
EOF
}

#===  FUNCTION  ================================================================
#          NAME:  get_script
#   DESCRIPTION:  Download the vim script
#    PARAMETERS:  NA
#       RETURNS:  NA
#===============================================================================
get_script()
{
read -p "Enter the script ID to download :: " script_id
echo "Downloading the description"
if [ ! -f $script_id_file$script_id ]
then
wget -o /dev/null -O $script_id_file$script_id 'http://www.vim.org/scripts/script.php?script_id='$script_id
fi
src_id_tmp=$(cat $script_id_file$script_id|grep src_id|head -1|sed -e 's/.*href="//')
src_id=$(echo $src_id_tmp|sed  -e 's/".*//')
filename=$(echo $src_id_tmp|sed  's/.*">//' |sed 's#<.*##')
echo "Downloading the file as $filename"
curl http://www.vim.org/scripts/$src_id 2>/dev/null > $filename
}

#===  FUNCTION  ================================================================
#          NAME:  add_script2GVLS
#   DESCRIPTION:  Add the script id to Get Latest VIM Scripts
#    PARAMETERS:  NA
#       RETURNS:  NA
#===============================================================================
add_script2GVLS()
{
read -p "Enter the Script ID to add : " script_id
script_name=$(cat $tmp_file | grep width| grep script_id= |sed 's/.*script_id=//'|tr -d "\""|tr ">" " "|sed 's/<.*//' |sort -n|grep "^$script_id "|sed 's/\([0-9]*\)\(.*\)/\2/')
echo "$script_id 1 $script_name"
cp ~/.vim/GetLatest/GetLatestVimScripts.dat ~/.vim/GetLatest/GetLatestVimScripts.backup
echo "$script_id 1 :AutoInstall: $script_name" >> ~/.vim/GetLatest/GetLatestVimScripts.dat
}

#===  FUNCTION  ================================================================
#          NAME:  get_list
#   DESCRIPTION:  Get the list of scripts for selective items
#    PARAMETERS:  NA
#       RETURNS:  NA
#===============================================================================
get_list()
{
echo "Getting the web page for the list of scripts..."
echo "Please be patient"

read -p "Enter the script ID to start from :" start_id
read -p "Enter the number of entries to display :" number_display
echo "Printing the list of the scripts with the script ID's from $start_id"

printf "\n\n%75s\n"|tr ' ' '='

cat $tmp_file | grep width| grep script_id= |sed 's/.*script_id=//'|tr -d "\""|tr ">" " "|sed 's/<.*//' |sort -n|sed -n '/^'$start_id' /,$ p'|head -n $number_display
printf "%75s\n\n\n\n"|tr ' ' '='
}

#-------------------------------------------------------------------------------
#   This is where we start the actual script in a infinite
#   loop. You can exit the loop with q.
#-------------------------------------------------------------------------------
echo "Getting the list of scripts ...."
echo "Hold on a few seconds, while I do some dirty work :)"
download_list
while true
do

print_header

read -p "Please enter your choice : " read_choice

case $read_choice in
'1')
get_all_list
;;
'2')
get_details
;;
'3')
get_script
;;
'4')
add_script2GVLS
;;
'5')
get_list
;;
'6')
rm -f $tmp_file
;;
'7')
get_all_list 1
;;
'8')
search_list
;;
'p')
echo "Current pager is $PAGER"
read -p "Enter the name of the pager to use :: " pager
export PAGER=$pager
;;
'q')
exit 0
;;
*)
echo "Not a valid input"
;;
esac
done

 

6 Good Web-Based FTP Clients For When You Are On The Road

Image representing MakeUseOf as depicted in Cr...
Image via CrunchBase

6 Good Web-Based FTP Clients For When You Are On The Road ftp clientsMost of the time, when you need to transfer files to your web hosting account or any other remote server, you might be at home on your laptop where you’ve got your favorite desktop FTP client installed. However, when you’re on the road or using a friend’s computer, a desktop FTP client may not be available.

The fastest solution for transferring files from anywhere in the world is by using a web based FTP client. Using such clients, you can transfer images or files from a digital camera or memory stick to a remote server from any computer. Here at MakeUseOf, we’ve covered a number of the best desktop FTP clients like FileZilla, which Mark reviewed and various other FTP clients for Windows or Mac.

When you’re on the go, desktop FTP clients just won’t do. You’ve got pics on the memory stick that you’ve got to upload to your website, and you need to do it now. So pull into a library or Internet cafe, fire up the web, and browse through this list of the five best web-based FTP clients.

The Top 6 Web Based FTP Clients JavaFTP JavaFTP is actually a java-based FTP client that I stumbled across when I first signed up for a web hosting plan at Webmasters.com. Over time, I’ve found that Webmasters isn’t the best hosting company in the world, but they did create this awesome web-based FTP client.

ftp clients

The reason it deserves the top rank for online FTP clients is because of the side-by-side window pane setup. I’ve noticed most Internet FTP tools use a very non-intuitive single-pane interface. However, the two-pane web-based clients have the look and feel of the best desktop clients. Transferring files is as simple as selecting the file in the left pane, and then clicking the “upload” button.

AnyClient Since side-by-side clients represent the best of the FTP breed of web-based clients, then it makes sense that the AnyClient FTP tool comes in a very close second. With AnyClient, you select the file in one pane and click the arrows to transfer to the other pane.

free ftp clients

The only reason I placed this one behind JavaFTP is because the control interface is a bit scattered throughout the tool, so it takes a little bit of searching around to figure out exactly what you want to do and how to do it.

The next few apps one the list are single-pane FTP clients, but they make the top 5 list because they offer additional functionality and are well-programmed. If I was hard pressed and ended up on a computer without the ability to run Java apps, I would resort to using one of the following clients.

Net2FTP free ftp clients

When I first visited Net2FTP, I really didn’t think I’d like it. The main page has the look of a very cheaply made website. However, once you log in and get into the tool, it’s actually well designed and very functional. Aside from the typical uploading and downloading functionality, you can also edit the files online by clicking “Edit” under the actions menu. This is a very useful feature because you can edit webpages on the fly without the need to download and then re-upload after edits – very cool!

FTPLive Next up is FTPLive, for the same reason Net2FTP made the list, because you get the added functionality of editing the files by clicking the edit icon under the “Operations” field.

free ftp clients

I don’t like the layout of this tool as much as others, or the fact that you have to scroll down to the bottom of the window to access the upload or download functions.

online ftp

With that said, the tool works well and offers everything you need in a web-based FTP client, and then some.

SmoothFTP The next online FTP tool that made the list is Smooth FTP. I actually like the look and feel of this tool. You can’t edit files on the fly, but you can change permissions and rename, and all of the functions like directory modifications or file transfers are all handled by clicking on the menu options at the top of the tool.

online ftp

Smooth FTP is easy, convenient, and it’ll get the job done fast.

Web to FTP The final tool that I’d like to mention is called Web to FTP. When I first saw the login page for this tool, I was sure it would make the top of the list because it looked like one of the other high-quality Java tools I’ve mentioned. Unfortunately, once you log in it looks like the rest of the single-window FTP tools.

ftp clients

It is laid out a bit odd, and the functionality is a bit lacking, but if you just need to quickly upload a file and you need a quick online tool to do so, Web to FTP is ready to serve.

What FTP tools do you use when you’re not at home and you need to upload files to your website? Do you have any of your own favorite online FTP clients? Do you have a favorite from this list? Offer your take in the comments section below.

Image Credit: class=”vt-p” rel=”nofollow” href=”http://www.sxc.hu/photo/615959″>T. Al Nakib

________________________________________________________________________ Follow MakeUseOf on Twitter. Includes cool extras.

________________________________________________________________________

Similar MakeUseOf Articles * The Top 3 Browser-Based IDE’s To Code In The Cloud (6 comments) * The Three Best Free FTP Clients for Windows (26 comments) * Podcast #15: Syncing Calendars, the Cloud and the iGun (4 comments) * Online FTP Clients: Use FTP Online without Installing A Client (18 comments) * Map Your FTP Drive As A Local Drive with NetDrive (Windows) (15 comments) * Jolicloud: The Operating System Download for Netbook You’ve Been Looking For (56 comments) * How Does Cloud Computing Work? [Technology Explained] (17 comments) * Build Yourself A Virtual Cloud To Fall Back On (22 comments) * AnyConnect – Incredibly Easy To Set Up Multi-Protocol File Transfer Client Software (1 comments) * Amazing Personal Cloud Computing with Tonido [MakeUseOf Giveaway] (181 comments)

URL: http://feedproxy.google.com/~r/Makeuseof/~3/R8bHSt83yHQ/

Enhanced by Zemanta