-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathFAQ
163 lines (123 loc) · 8.24 KB
/
FAQ
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
Created : 09/29/2013
Updated : 20/11/2013
What the hell is glutil?
------------------------
Good question! Originally the concept was to create a binary that could insert a single release into the dirlog
containing all the information that dirlog holds and not become corrupt. Basically the binary was created to successfully
update and rebuild the dirlog.
Sounds like glupdate, why would I waste my time with glutil?
------------------------------------------------------------
Although glutil was primarily created to manipulate the dirlog, it evolved into something much greater. The command
glutil --help | more is a perfect example of what glutil is capable of. imdb , tvrage and game rating output is a nice
feature. Wouldn't it be nice to have your very own imdb/tvrage/game database locally on your shell? Create a bash script
that could easily archive based on ratings? How about nuking based on language, country, rating, score, genre? glutil
has soo many possibilities. glutil can watch your connected users in realtime. Check out the MANUAL and DATA_STRUCTURES.
How do I upgrade just the glutil.c file?
----------------------------------------
step 1 : /glftpd/bin/glutil -m glutil-update
Is glutil compatible with freebsd?
----------------------------------
Yes indeed it is! Use the freebsd folder, it should have everything you need to run scripts and utilize macros.
I get "ERROR: could not get own path" what do I do?
---------------------------------------------------
If you get the error in freebsd "ERROR: could not get own path" you must mount procfs:
mount -t procfs proc /proc
For certain features to work properly, procfs needs to always be mounted;
This means when running glutil from a chrooted environment, you should mount
procfs there:
mount -t proc proc /glroot/proc (linux example)
How do I store static information so I don't have to edit files every time?
---------------------------------------------------------------------------
Note: glutil is designed to grab information from glftpd.conf and glconf.h you shouldn't have to edit the glutil.c file.
Note: editing the glconf.h is not absolutely necessary, but will help save your settings if ever upgrades occur.
Example of what to insert into glconf.h ( configure it the way you have your glftpd setup ) :
#define GLCONF "/glftpd/etc/glftpd.conf"
#define glroot "/glftpd"
#define siteroot "/site"
#define dir_log "/glftpd/ftp-data/logs/dirlog"
#define nuke_log "/glftpd/ftp-data/logs/nukelog"
#define dupe_file "/glftpd/ftp-data/logs/dupefile"
#define last_on_log "/glftpd/ftp-data/logs/laston.log"
#define oneliner_file "/glftpd/ftp-data/logs/oneliners.log"
#define imdb_file "/glftpd/ftp-data/logs/imdb.log"
#define game_log "/glftpd/ftp-data/logs/game.log"
#define tv_log "/glftpd/ftp-data/logs/tv.log"
#define ge1_log "/glftpd/ftp-data/logs/gen1.log"
#define du_fld "/glftpd/bin/glutil.folders"
#define shm_ipc 0x0000DEAD
What the hell are macros?
-------------------------
As you have already found out glutil is very complex. It can do wonderous magical things. Creating macros allows you to
combine commands and shorten them so that they are easy to remember. If you look in the misc folder you will see the
macros.glutil file. Follow the examples to create new ones. It's very important to follow the MANUAL for proper syntax
especially when dealing with tvrage and imdb.
glutil -m : will call a macro. A macro can combine commands and call a bash script. Soo many possibilities.
How do I use glutil to do a imdb or tvrage lookup?
--------------------------------------------------
To utilize imdb and tvrage lookups you can use the included scripts imdb_get.sh and tvrage_get.sh. These scripts are
called by using the -m flag.
glutil -m imdb-e -arg1="Goodfellas"
This will do a lookup on imdb.com for the movie title and add it to the imdb.log
glutil -m tvrage-e -arg1="Sons Of Anarchy"
This will do a lookup on tvrage.com for the television title and add it to the tv.log.
glutil -m imdb-d --arg1 '\/(xvid|x264|archive\/x264|archive\/xvid)\/.*\-[a-zA-Z0-9\-_]+$'
This will search the dirlog and look for movies in the folders xvid and x264. It will then gather imdb information
and place into imdb.log.
glutil -m imdb --arg1=/glftpd/site/xvid
This will do imdb lookups for all the movies located in xvid folder.
examples to run on freebsd :
glutil -m imdb-f-e --arg1="Shawshank Redemption"
glutil -m idmb-f-d --arg1 '\/(MOVIES-SD|MOVIES-HD|ARCHIVE\/MOVIES-SD|ARCHIVE\/MOVIES-HD)\/.*\-[a-zA-Z0-9\-_]+$'
glutil -m tvrage-f-e --arg1="Breaking Bad"
glutil -m tvrage-f-d --arg1='\/(TV-SD|TV-HD|TV-DVDRIP|ARCHIVE\/TV-HD|ARCHIVE\/TV-SD|ARCHIVE\/TV-DVDRIP)\/.*\-[a-zA-Z0-9\-_]+$'
Seems when I run the imdb_get.sh macro the imdb info isn't getting pulled from the web. The script works perfectly fine
outside of chroot. How do I fix this?
------------------------------------------------------------------------------------------------------------------------
This is a missing lib issue. In the chroot environment DNS resolving sometimes doesn't work. Simply copy the two files
libnss_files.so.2 libnss_dns.so.2 to your /glftpd/lib folder and try again. Also it is really important to have an up to
date version of xmllint ( 20707 and up ).
Usage examples:
------------------------------------------------------------------
This will watch connected users in real time, organizing output into a table.
watch -n 1 ./glutil -w --comp
This will print out the users connected to the site and place in an organized table and loop it for 10 seconds,
clearing the screen each time.
glutil -w --comp --loop 10 --loopexec clear
This will rebuild the entire dirlog. A backup of original will be created.
glutil -r
This will update the existing dirlog and remove enteries that no longer exist. Great for fixing paths if directories
have been moved.
glutil -r -u -v --postexec "{exe} --check --fix --ghost -v"
This will dump the dirlog in readable format to stdout.
glutil -d
This will dump the dirlog in readable format to stdout.
The more -v you use the more verbose information will be printed out.
glutil -d -vv
Print the users that are online.
glutil -w
This will print out online users with pid and loop the information every 1 second.
glutil -w -print "username: {user} | pid: {pid}" --loop 1 --loopexec "clear" --preexec "clear" --silent
This will print out all movies with comedy genre of scores greater than 6, sorted ascending by score.
glutil -a -l: genres -regexi "comedy" -and -lom "score > 6.0" -print " {(?P:(score)#%-4s)} | {title#%-40s} ({year}) | {country} | {language} {:n}------|-- {(?P:plot#%.120s)} " --sort score
This will print out the tvrage info stored in the tv.log, case insensative.
glutil -h -l: name -regexi "Hell On Wheels"
Remove from the dirlog what is in the regex. In this case it would remove any entries with repeating
back-slashes in path
glutil -e dirlog -vvv ! -regex "[\/]{2,}"
Output all the entries in the nukelog that are under 7 days of age.
glutil -n -lom "time < (curtime-604800)"
Finds dupes in dirlog - all match params apply. If no explicit match is given, it dupefinds for all records (can take
a long time)
glutil -p -l: ?b:dir -match "Some.Dir.LA-LA"
Do a recursive search for files or symlinks in /glftpd/site, that contain the
word 'share' in path (case-insensitive) and are not older than 7 days
(604800 secs). Stays on the current filesystem. Prints to stdout.
Type glutil --info -vv to see the list of modes that can be matched against.
glutil -x / -R -xdev -lom "ctime > (curtime-604800) && mode == 10 || mode == 8" -and -l: ?b:path -regexi "share" -print "Mode: {(?P:(mode#%-5d))} {(?P:(?tl:mtime)#%-25s)} {path}"
glutil is supposed to be able to show me game ratings, how is that done?
------------------------------------------------------------------------
This is another macro that calls the bash script called gb_get.sh. This script will retrieve game information from
the api generated by the web site http://www.giantbomb.com. You will require an account to use it. It's easy to do
and in the end they will give you a API KEY. You will need to insert this long key into the gb_get.sh script where it
says API_KEY="" once this is done you can simply type : glutil -m gamescore --arg1=/glftpd/site/games NOTE: only games
that have been reviewed and given ratings will output a score.