More cleanup, update pdf-parser.py

This commit is contained in:
Nemo 2020-05-03 18:17:01 +05:30
parent 419bb73fd0
commit 7a426b9877
18 changed files with 4219 additions and 2018 deletions

View File

@ -1,8 +0,0 @@
<?php
include '../~github/CFPropertyList/CFPropertyList.php';
$plist = new CFPropertyList('/tmp/Books.plist');
$a = $plist->toArray();
$a = $a['Books'];
foreach($a as $book)
if(substr($book['Path'],-4) == '.pdf')
echo $book['Path']." - ".$book['Name']."\n";

59
imdb
View File

@ -1,59 +0,0 @@
#!/usr/bin/python
import urllib
import argparse
from xml.etree import ElementTree
import sys
def retrieveMovie (title):
title=urllib.quote(title.encode("utf8"))
URL="http://www.omdbapi.com/?r=xml&plot=full&t=%s" % title
xml = ElementTree.parse(urllib.urlopen(URL))
#fall back to movie search if no movie is found
for A in xml.iter('root'):
if (A.get('response')=='False'):
print "Movie not found!"
sys.exit()
xml=xml.getroot()
printInfo(xml)
return xml
#Search for movie and return plot for all the results
def movieSearch (title):
title=urllib.quote(title.encode("utf8"))
URL="http://www.omdbapi.com/?r=xml&s=%s" % title
xml = ElementTree.parse(urllib.urlopen(URL))
xml=xml.getroot()
for B in xml.findall('Movie'):
apicall=retrieveMovie(B.get('Title'))
printInfo(apicall)
return xml
def printInfo(xml):
for B in xml.findall('movie'):
print "\n%s (%s) || %s || %s\n" %(B.get('title'),B.get('year'),
B.get('runtime'),B.get('imdbRating'))
print "Director: %s\nActors: %s\n" %(B.get('director'),B.get('actors'))
print "%s\n" %(B.get('plot'))
if __name__=='__main__':
parser=argparse.ArgumentParser(description='Command-Line Interface for the IMdB')
parser.add_argument("-t", help="Search by title. Return first result")
parser.add_argument("-s", help="Search and return results")
args=parser.parse_args()
choices=["None"]
try:
choices[0]=sys.argv[1]
title=sys.argv[2]
except:
parser.print_usage()
sys.exit()
if choices[0]=="-t":
retrieveMovie(title)
else:
movieSearch(title)

View File

@ -1,22 +0,0 @@
#!/usr/bin/expect -f
set prompt "#"
set address [lindex $argv 0]
spawn bluetoothctl
expect -re $prompt
send "power on\r"
expect "Changing power on succeeded"
expect -re $prompt
send "agent on\r"
expect -re $prompt
send "default-agent\r"
expect "Default agent request successful"
expect -re $prompt
send "connect C0:28:8D:14:7A:9E\r"
expect "Attempting to connect to C0:28:8D:14:7A:9E"
expect -re "Connection successful"
send_user "\n jaybird connected.\n"
sleep 2
send "quit\r"
expect eof

BIN
kiss.sh

Binary file not shown.

12
mfd.sh
View File

@ -1,12 +0,0 @@
#! /bin/bash
#echo Mediafire Download Script using Plowdown + Axel
#echo Usage mfd URL [num]
url=$1
if [ ${url:0:4} != http ]; then
url="http://$url"
fi
#echo ${url:0:4}
echo Downloading $url
plowdown -p mtvz --run-download="axel -n 20 -a %url" $url
#Plowdown using axel and 10 threads to download the url

View File

@ -1,5 +0,0 @@
#!/bin/bash
sudo rm /var/lib/mongodb/mongod.lock
sudo -u mongodb mongod -f /etc/mongodb.conf --repair
sudo start mongodb
sudo status mongodb

View File

@ -1,21 +0,0 @@
#! /usr/bin/php
<?php
/**
* My password generator
* based on the lifehacker suggestion
* Password = md5("l"+key+"r");
* l,r = first,last letter of domain name
*/
//you get individual secure passwords that you can
//regenrate easily
$cout = fopen("php://stdout","w");
fwrite($cout,"Enter domain name: ");
$cin = fopen('php://stdin','r');
$domain = fread($cin,4096);
fwrite($cout,"Enter key pass phrase: ");
$cin = fopen('php://stdin','r');
$key = fread($cin,4096);
echo "Password : ". md5($domain[0].$key.substr($domain,-1))."\n";

File diff suppressed because it is too large Load Diff

BIN
phpCB

Binary file not shown.

View File

@ -1,60 +0,0 @@
Port 21 unblocked
Port 22 unblocked
Port 53 unblocked
Port 80 unblocked
Port 81 unblocked
Port 110 unblocked
Port 161 unblocked
Port 162 unblocked
Port 210 unblocked
Port 443 unblocked
Port 465 unblocked
Port 554 unblocked
Port 587 unblocked
Port 993 unblocked
Port 995 unblocked
Port 1720 unblocked
Port 1935 unblocked
Port 1985 unblocked
Port 2000 unblocked
Port 2020 unblocked
Port 2082 unblocked
Port 2083 unblocked
Port 2095 unblocked
Port 2096 unblocked
Port 2401 unblocked
Port 3230 unblocked
Port 3231 unblocked
Port 3232 unblocked
Port 3233 unblocked
Port 3234 unblocked
Port 3235 unblocked
Port 3236 unblocked
Port 3237 unblocked
Port 3238 unblocked
Port 3239 unblocked
Port 3240 unblocked
Port 3241 unblocked
Port 3242 unblocked
Port 3243 unblocked
Port 3386 unblocked
Port 4764 unblocked
Port 4765 unblocked
Port 8008 unblocked
Port 8080 unblocked
Port 8081 unblocked
Port 8085 unblocked
Port 8400 unblocked
Port 8443 unblocked
Port 9091 unblocked
Port 10098 unblocked
Port 10099 unblocked
Port 12359 unblocked
Port 15003 unblocked
Port 18000 unblocked
Port 20001 unblocked
Port 27001 unblocked
Port 47372 unblocked
Port 47373 unblocked
Port 52709 unblocked
Port 52710 unblocked

View File

View File

@ -1,5 +0,0 @@
#!/bin/bash
sudo rmmod sdhci-pci sdhci
sudo modprobe sdhci debug_quirks2=4
sudo modprobe sdhci-pci

4
spoj
View File

@ -1,4 +0,0 @@
#!/bin/bash
problem=$1
g++ $1.cpp -o $1; ./$1 < $1.IN > $1.OUT
diff $1.TXT $1.OUT

5228
swaks

File diff suppressed because it is too large Load Diff

BIN
tmsu

Binary file not shown.

View File

@ -1,4 +1,5 @@
#!/bin/sh
# The output for this will likely be pulseaudio
for i in /proc/[0-9]*/fd/*
do
var="$(readlink $i)"
@ -6,4 +7,4 @@ do
then
echo $i
fi
done
done

View File

@ -1,40 +0,0 @@
#! /bin/sh
# minimize/restore windows on current desktop
# -----------------------------------
# vermaden [AT] interia [DOT] pl
# http://toya.net.pl/~vermaden/links.htm
CURRENT_DESKTOP=$( wmctrl -d | egrep "^[0-9][ ]{2}\*" | awk '{print $1}' )
WINDOW_LIST=$( wmctrl -l | egrep "^[0-9]x.{8}\ {2}${CURRENT_DESKTOP}" | awk '{print $1}' )
WINDOW_COUNT=0
for WINDOW in ${WINDOW_LIST} ;do
WINDOW_COUNT=$(( ${WINDOW_COUNT} + 1 ))
done
minimize () {
for WINDOW in ${WINDOW_LIST}; do
wmctrl -t ${CURRENT_DESKTOP} -i -r ${WINDOW} -b add,hidden
done
}
restore () {
for WINDOW in ${WINDOW_LIST}; do
wmctrl -t ${CURRENT_DESKTOP} -i -r ${WINDOW} -b remove,hidden
done
}
MINIMIZED=0
for WINDOW in ${WINDOW_LIST}; do
if xprop -id ${WINDOW} _NET_WM_STATE | grep -q NET_WM_STATE_HIDDEN; then
MINIMIZED=$(( ${MINIMIZED} + 1 ))
fi
done
if [ ${MINIMIZED} -eq ${WINDOW_COUNT} ]; then
restore
else
minimize
fi

Binary file not shown.