Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Fur

Pages: [1] 2 3 ... 11
1
.NET Framework / Re: [C#] Thread Safe Random and CryptoRandom
« on: February 02, 2016, 07:02:53 pm »
Code: (CSharp) [Select]
var buffer = new byte[4];
Global.GetBytes(buffer);
_local = inst = new Random(BitConverter.ToInt32(buffer, 0));
return inst.Next();
System.Random isn't cryptographically secure to my knowledge -- which is limited since I couldn't find much information about it -- and its seed space apparently is 2^32 - not outside the range of a bruteforce search and certainly faster than bruteforcing a 2^128 AES key generated using this class. You should really be using RNGCryptoServiceProvider here, or was there a technical reason you used Random instead?

2
General discussion / Re: Copy of Windows 7?
« on: January 29, 2016, 08:26:40 pm »
http://mirror.corenoc.de/digitalrivercontent.net/ is a torrent mirror of the official Windows 7 images that Microsoft used to provide. It includes multiple languages and editions, all without the registration wall of mydigitallife.

3
Projects and Discussion / Re: Pinger - A Finished Python Project
« on: January 03, 2016, 05:07:25 am »
Code: (Python) [Select]
print '\033[1;32mSOME MESSAGE\033[1;m'
It would be better to replace these with a function and function call:
Code: (Python) [Select]
def print_light_green(str):
    # Unless you've seen it before, "033[1;32m" is probably meaningless. What if you want to change the colour, or don't bother colouring output if using Windows?
    # We use a function here to communicate what it does through its name and make it easier to change due to being in a single place, not to mention remove repetition and 'noise' in the code.
    print '033[1;32m' + str + '\033[1;m'


print_light_green("Hello, world!")
print_light_green("Isn't this much prettier?")

Code: (Python) [Select]
non_blank_count = 0

with open('URL_list.txt') as infp:
    for line in infp:
       if line.strip():
          non_blank_count += 1

fo = open("URL_list.txt", "rw+")
Why are you opening this twice, the second in rw mode?
Code: (Python) [Select]
file = open('url_list.txt')

non_blank_lines = 0
for line in file:
  if line.strip():
    non_blank_lines += 1

file.seek(0, 0) # Go back to beginning of file.
Note how I've given your variables more descriptive names and grouped the blank line calculation code together to show that they're related and doing a specific task, making it easier for a programmer to skim over.

Code: (Python) [Select]
line = fo.readline()
print '\033[1;33mPinging: %s \033[1;m' % (line),

for x in range(0, URL):
os.system("ping -c 1 %s" % (line)),
line = fo.readline()
print '\033[1;33mPinging: %s \033[1;m' % (line),
What an odd way to do things. I guess you didn't use for line in file for learning purposes, but why do this in and out of the loop instead of:
Code: (Python) [Select]
for x in range(0, non_blank_lines):
        line = file.readline()
        continue if !file.strip() # Skip if the line is blank :P I think this is valid syntax || Perl has altered my memories.
        print_light_green("Pinging: %s' % (line))
os.system("ping -c 1 %s" % (line))

file.close()

Note that I use the non_blank_lines variable instead of URL because it tells us more about what is contained in the variable, Python tends to prefer lowercase_with_underscores for most variables, and URL was non_blank_lines anyway. Also, it's never a bad thing to close files when we're done.

I don't know, is this even Python?
Batch.

4
I used this website to download the extension crx and this website/extension to view the JavaScript source:
Code: (JavaScript) [Select]
    function sendRequest() {
        var request;
        var browser = navigator.appName;
     
        request = new XMLHttpRequest;
     
        request.onreadystatechange = function() {
            if (request.readyState != 4) {
                document.getElementById("result")
                    .style.display = "none";
                document.getElementById("waiting")
                    .style.display = "block";
            } else {
                document.getElementById("waiting")
                    .style.display = "none";
                document.getElementById("result")
                    .style.display = "block";
     
                document.getElementById("result")
                    .innerHTML = request.responseText;
            }
        }
     
        request.open("GET", "http://programming.rs/hackers-toolkit/action.php?" + "type=" + document.getElementById("type")
            .value + "&hash=" + encodeURIComponent(btoa(document.getElementById("hash")
                .value)), true);
        request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        request.send();
    }
    document.addEventListener("click", function(event) {
        if (event.target.type == "button") {
            var type = document.getElementById("type")
                .value;
            var hash = encodeURIComponent(btoa(document.getElementById("hash")
                .value));
     
            if ((type.length + hash.length) < 6000) {
                sendRequest();
            } else {
                document.getElementById("waiting")
                    .style.display = "none";
                document.getElementById("result")
                    .style.display = "block";
     
                document.getElementById("result")
                    .innerHTML = "Request too long.";
            }
     
        } else if (event.target.id == "result") {
            var div = document.createRange();
            div.setStartBefore(event.target);
            div.setEndAfter(event.target);
            window.getSelection()
                .addRange(div);
        } else if (event.target.id == "homepage" || event.target.id == "help" || event.target.id == "author") {
            window.open(event.target.href);
        }
    }, false);
It strikes me as odd that you would do something so simple server side and use your bandwidth, processor time, your users' time waiting for the server response, require network connectivity, have it depend on an external service (what happens when the website goes down?), and expose their input both to the server and the network... is JavaScript just that painful? :P

6
Creative Arts / Re: The Music Thread
« on: November 12, 2015, 08:36:27 pm »
I'm a fan of psybient, psychill, semi electro / ambient genre as it helps me relax or focus on task at hand without being a distraction.

If you guys share similar tastes, feel free to suggest me some new stuff.
Have you ever heard of SomaFM, in particular Deep Space One and Space Station Soma? Very good radio stations if you're into ambient and the like. Tim Hecker and Aurastore may be to your tastes.

My music taste usly depends on my mood. https://m.youtube.com/watch?v=qlEW_mLZ22U
Video seems to have been removed on copyright claim. https://www.youtube.com/watch?v=Eraarv6QCog is the same song, isn't it?


Alva Noto + Ryuichi Sakamoto - Vrioon
Alva Noto + Ryuichi Sakamoto - utp
Hiroshi Yoshimura - Music for Nine Postcards (I've only been able to find a 192kbps mp3 rip of this unfortunately)
Goldmund - Corduroy Road
Max Richter - The Blue Notebooks

7
rm -rf ~/downloads/*.torrent
Or
Code: [Select]
del /s %USERPROFILE%\Downloads\*.torrent under Windows (IIRC) since the directory in his code implies he's using Windows.

8
General discussion / Re: Post your deskTOP
« on: August 07, 2015, 02:29:55 pm »
I'm actually liking  Mint so far. Only real annoyance is that I can't see desktop filenames properly, but that's easily fixed.
A year later. God that config was ugly.

9
General discussion / Re: Should people use Adblock?
« on: February 14, 2015, 12:59:06 am »
I don't really see the benefit in that? Adblock Plus + Disconnect or Ghostery = win!
http://arstechnica.com/business/2015/02/over-300-businesses-now-whitelisted-on-adblock-plus-10-pay-to-play/
https://github.com/gorhill/uBlock#performance

Plus uBlock is much more polished IMO, like how host-style blocking rules are supported and popular filter lists are already listed in the filter list settings page.

10
General discussion / Re: Post your deskTOP
« on: February 12, 2015, 05:19:16 am »
Pretty basic, Slackware and fluxbox...
> Groove Salad
Your taste in music is good.

I like the blue and grey theme you've got going on there. I don't see graphical consistency very often.

11
So.... a seedbox? I only quickly glanced over the website's home page but I see no real differences between this and a seedbox running a client that can download torrent chunks sequentially. I'll have to look into this a bit more when I'm not busy.

12
General discussion / Re: Tech Confessions?
« on: December 28, 2014, 01:31:40 am »
* I once ripped out a NiMh battery pack from a toy car that had no charger, found a loose USB cable somewhere and thought I could make that battery pack charge. I spun the wires together (according to color) and plugged it in. What happened next was a short circuit and I almost fried a motherboard lol.
Sounds like an Etherkiller :P

I rarely write unit tests. I know I should and it would make troubleshooting easier but I can never be bothered to.
I only use 4 or so fingers for typing. My coordination is awful.
I used to despise GNU/Linux as a desktop OS because I considered it clunky and half-baked. This opinion was based on my experience with default XFCE on Debian.

13
Nice, I didn't realize youtube-dl supported all those sites. Does it also convert filetypes?
It can download multiple formats if they're available:
Quote from: man youtube-dl
   Video Format Options:
              -f, --format FORMAT              video format code, specify the order of
                                               preference using slashes: -f 22/17/18 .  -f
                                               mp4 , -f m4a and  -f flv  are also
                                               supported. You can also use the special
                                               names "best", "bestvideo", "bestaudio",
                                               "worst", "worstvideo" and "worstaudio". By
                                               default, youtube-dl will pick the best
                                               quality. Use commas to download multiple
                                               audio formats, such as -f
                                               136/137/mp4/bestvideo,140/m4a/bestaudio.
                                               You can merge the video and audio of two
                                               formats into a single file using -f <video-
                                               format>+<audio-format> (requires ffmpeg or
                                               avconv), for example -f
                                               bestvideo+bestaudio.
              --all-formats                    download all available video formats
              --prefer-free-formats            prefer free video formats unless a specific
                                               one is requested
              --max-quality FORMAT             highest quality format to download
              -F, --list-formats               list all available formats
Or convert to other formats:
Quote from: man youtube-dl
   Post-processing Options:
              -x, --extract-audio              convert video files to audio-only files
                                               (requires ffmpeg or avconv and ffprobe or
                                               avprobe)
              --audio-format FORMAT            "best", "aac", "vorbis", "mp3", "m4a",
                                               "opus", or "wav"; "best" by default
              --audio-quality QUALITY          ffmpeg/avconv audio quality specification,
                                               insert a value between 0 (better) and 9
                                               (worse) for VBR or a specific bitrate like
                                               128K (default 5)
              --recode-video FORMAT            Encode the video to another format if
                                               necessary (currently supported:
                                               mp4|flv|ogg|webm|mkv)
However it is implied later in the manual that avconv or ffmpeg is required for the latter options, which is understandable.

14
I prefer youtube-dl, though xVideoServiceThief does support some sites I don't think youtube-dl does.

Oh, and here's a list of supported sources that youtube-dl can download from:
Code: [Select]
$ youtube-dl --list-extractors
1up.com
220.ro
3sat
4tube
56.com
5min
8tracks
9gag
abc.net.au
AcademicEarth:Course
AddAnime
AdultSwim
Aftonbladet
Allocine
anitube.se
AnySex
Aparat
AppleTrailers
archive.org
ARD
ARD:mediathek
arte.tv
arte.tv:+7
arte.tv:concert
arte.tv:creative
arte.tv:ddc
arte.tv:embed
arte.tv:future
audiomack
AUEngine
bambuser
bambuser:channel
Bandcamp
Bandcamp:album
bbc.co.uk
Beeg
BehindKink
Bild
BiliBili
blinkx
blip.tv:user
BlipTV
Bloomberg
BR
Break
Brightcove
BYUtv
Canal13cl
canalc2.tv
Canalplus
CBS
CBSNews
CeskaTelevize
channel9
Chilloutzone
Cinemassacre
clipfish
cliphunter
Clipsyndicate
Cloudy
Clubic
cmt.com
CNET
CNN
CNNBlogs
CollegeHumor
ComedyCentral
ComedyCentralShows
CondeNast
Cracked
Criterion
Crunchyroll
crunchyroll:playlist
CSpan
culturebox.francetvinfo.fr
dailymotion
dailymotion:playlist
dailymotion:user
daum.net
DBTV
DeezerPlaylist
defense.gouv.fr
Discovery
divxstage
Dotsub
Dropbox
DrTuber
DRTV
Dump
EbaumsWorld
eHow
Einthusan
eitb.tv
EllenTV
EllenTV:clips
ElPais
EMPFlix
Engadget
Eporner
Escapist
EveryonesMixtape
exfm
ExpoTV
ExtremeTube
facebook
faz.net
fc2
fernsehkritik.tv
fernsehkritik.tv:postecke
Firedrive
Firstpost
firsttv
Flickr
france2.fr:generation-quoi
FranceCulture
FranceInter
francetv
francetvinfo.fr
Freesound
freespeech.org
FreeVideo
FunnyOrDie
Gamekings
GameOne
gameone:playlist
GameSpot
GameStar
Gametrailers
GDCVault
generic
Glide
Globo
GodTube
GoldenMoustache
Golem
GorillaVid
Goshgay
Grooveshark
Hark
Heise
Helsinki
HentaiStigma
HornBunny
HostingBulk
HotNewHipHop
Howcast
HowStuffWorks
HuffPost
Hypem
Iconosquare
ign.com
imdb
imdb:list
Ina
InfoQ
Instagram
instagram:user
InternetVideoArchive
IPrima
ivi
ivi:compilation
Izlesene
JadoreCettePub
JeuxVideo
Jove
jpopsuki.tv
Jukebox
Kankan
keek
KeezMovies
KhanAcademy
KickStarter
kontrtube
KrasView
Ku6
la7.tv
Laola1Tv
lifenews
LiveLeak
livestream
livestream:original
livestream:shortener
lrt.lt
lynda
lynda:course
m6
macgamestore
mailru
Malemotion
MDR
metacafe
Metacritic
Mgoon
MinistryGrid
mitele.es
mixcloud
MLB
MoeVideo
Mofosex
Mojvideo
Moniker
mooshare
Morningstar
Motherless
Motorsport
MovieClips
Moviezine
movshare
MPORA
MTV
mtviggy.com
mtvservices:embedded
MuenchenTV
MusicPlayOn
MusicVault
muzu.tv
MySpace
MySpass
myvideo
Naver
NBA
NBC
NBCNews
ndr
NDTV
Newgrounds
Newstube
nfb
nfl.com
nhl.com
nhl.com:videocenter
niconico
NiconicoPlaylist
Noco
Normalboots
NosVideo
novamov
Nowness
nowvideo
npo.nl
NRK
NRKTV
NTV
Nuvid
NYTimes
ocw.mit.edu
OktoberfestTV
on.aol.com
Ooyala
orf:oe1
orf:tvthek
ORFFM4
parliamentlive.tv
Patreon
PBS
Phoenix
Photobucket
PlanetaPlay
play.fm
played.to
Playvid
plus.google
pluzz.francetv.fr
podomatic
PornHd
PornHub
Pornotube
PornoXO
PromptFile
prosiebensat1
Pyvideo
QuickVid
radiofrance
Rai
RBMARadio
RedTube
ReverbNation
RingTV
RottenTomatoes
Roxwel
RTBF
RTLnow
rtlxl.nl
RTS
rtve.es:alacarta
rtve.es:live
RUHD
rutube
rutube:channel
rutube:movie
rutube:person
RUTV
Sapo
savefrom.net
SBS
SciVee
screen.yahoo:search
Screencast
ServingSys
Sexu
SexyKarma
Shared
ShareSix
Sina
Slideshare
Slutload
smotri
smotri:broadcast
smotri:community
smotri:user
Snotr
Sockshare
Sohu
soundcloud
soundcloud:playlist
soundcloud:set
soundcloud:user
Soundgasm
southpark.cc.com
southpark.de
Space
Spankwire
Spiegel
Spiegel:Article
Spiegeltv
Spike
Sport5
SportBox
SportDeutschland
SRMediathek
stanfordoc
Steam
streamcloud.eu
StreamCZ
SunPorno
SWRMediathek
Syfy
SztvHu
Tagesschau
Tapely
teachertube
teachertube:user:collection
TeachingChannel
Teamcoco
TechTalks
techtv.mit.edu
TED
tegenlicht.vpro.nl
telecinco.es
TeleMB
TenPlay
TestURL
TF1
TheOnion
ThePlatform
TheSixtyOne
ThisAV
THVideo
THVideoPlaylist
tinypic
tlc.com
tlc.de
TNAFlix
tou.tv
Toypics
ToypicsUser
TrailerAddict (CURRENTLY BROKEN)
Trilulilu
TruTube
Tube8
Tudou
Tumblr
Turbo
Tutv
tv.dfb.de
tvigle
tvp.pl
TVPlay
Twitch
Ubu
udemy
udemy:course
Unistra
Urort
ustream
ustream:channel
Vbox7
VeeHD
Veoh
Vesti
Vevo
VGTV
vh1.com
Vice
Viddler
video.google:search
video.mit.edu
VideoBam
VideoDetective
videofy.me
videolectures.net
VideoMega
VideoPremium
VideoTt
videoweed
Vidme
Vidzi
viki
vimeo
vimeo:album
vimeo:channel
vimeo:group
vimeo:likes
vimeo:review
vimeo:user
vimeo:watchlater
Vimple
Vine
vine:user
vk.com
Vodlocker
Vporn
VRT
vube
VuClip
vulture.com
Walla
WashingtonPost
wat.tv
WayOfTheMaster
WDR
wdr:mobile
WDRMaus
Weibo
Wimp
Wistia
WorldStarHipHop
wrzuta.pl
XBef
XboxClips
XHamster
XNXX
XTube
XTubeUser
XVideos
Yahoo
Ynet
YouJizz
Youku
YouPorn
YourUpload
youtube
youtube:channel
youtube:favorites
youtube:history
youtube:playlist
youtube:recommended
youtube:search
youtube:search:date
youtube:search_url
youtube:show
youtube:subscriptions
youtube:toplist
youtube:truncated_url
youtube:user
youtube:watch_later
ZDF

15
Found it on the Webs / Re: Decentralized web [project-maelstrom]
« on: December 12, 2014, 05:25:29 pm »
Doesn't Freenet already do something like this?

BitTorrent Inc. are really stepping up their game recently. I find it funny how they seem to be focusing on privacy what with the surveillance schemes that's been exposed yet all (that I am aware of) their software is proprietary and therefore could be easily backdoored. Seems lots of other products are doing the same (see: pretty much all mobile chat programs).

Pages: [1] 2 3 ... 11