This forum is in archive mode. You will not be able to post new content.

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 - Lenoch

Pages: 1 [2]
16
Beginner's Corner / Re: java search database
« on: September 01, 2015, 02:33:46 PM »
Can you post your code? it helps in understanding your question.

17
General discussion / Re: Your top 10 hacker/computer related films
« on: August 25, 2015, 05:10:23 PM »
Evilzone: The movie

I would watch that considering 50% is probably just porn.


18
High Quality Tutorials / Re: Downing a Site using Slowloris
« on: August 18, 2015, 10:11:31 PM »
Another alternative for slowloris is torshammer. It's written in python:

link http://sourceforge.net/projects/torshammer/files/Torshammer/1.0/

19
Scripting Languages / Re: [Ruby] a weather notification script
« on: August 18, 2015, 02:16:21 AM »
I don't have a DE with this that's why just use dzen and I just want the weather when I run weather. And yes autowriting is a good idea!

20
Scripting Languages / [Ruby] a weather notification script
« on: August 18, 2015, 01:15:54 AM »
A little script I made that fits in my desktop workflow

Code: [Select]
#!/usr/bin/ruby

require 'rubygems'
require 'json'
require 'etc'
require 'net/http'
require 'fileutils'
require 'configparser'

class Weather
  def initialize(location, link)
    @location = location
    @link = link
    @data = get_data
  end

  def kelvin_to_celcius(kelvin)
    ((kelvin - 273.15) * 1).round.to_s
  end

  def get_data
    uri = URI(@link + @location)
    Net::HTTP.get(uri)
  end

  def get_degrees
    json = JSON.parse( @data )
    kelvin_to_celcius(json["main"]["temp_min"].to_i)
  end

  def to_s
    get_degrees + "°C In " + @location
  end
end

conf_dir = '/home/' + ENV['USER'] + '/.weatherdzen/'

unless File.exists? conf_dir
  FileUtils.mkpath conf_dir
  FileUtils.touch conf_dir + 'config'
 
  File.open(conf_dir + 'config', "w") do |f|
    f.puts('[basic]')
    f.puts('location=Antwerp')
    f.puts('notify=notifysend')
    f.close
  end
end

cfg = ConfigParser.new(conf_dir + 'config')

weather = Weather.new(
  cfg["basic"]["location"],
  "http://api.openweathermap.org/data/2.5/weather?q="
)

notifier = cfg["basic"]["notify"]
wtr =  weather.to_s

if notifier == "dzen"
  exec 'echo ' + wtr + '| dzen2 -title-name "brightness" -l 3 -bg "#263238" -fg "#b1fff8" -x 790 -y 480 -w 270 -h 70 -p 3 -e'
elsif notifier == "notifysend"
  exec 'notify-send "' + wtr + '"'
end


Needs  etc and configparser gems + dzen2 installed.

EDIT:autowrite config, autowrite based on users location coming later
EDIT2: for people with xfce and unity and any other DE that uses notify-send you can now use that and configure in the config file

21
General discussion / Re: Post your deskTOP
« on: August 07, 2015, 04:24:17 PM »
I'm going to drop my stuff over here since someone bumped it.



For those asking, i'm running herbstluftwm. A manual tiling window manager. my dzen2 bar on top is customized by myself.

22
Ok there are alot of issues with your code. And I want you to fix them first before I help you fix your problem because it's almost unreadable.

Use prepared statements man. this is 2015 the functions you are using are deprecated.

Don't echo your html out to the page. Try to put as less code you can into the html part. When you need to have certain html on certain conditions use:
Code: [Select]
<?php if($leet == true): ?>
<form method="post" action="leetscript.php">
<input type="text" name="something"/>
</form>
<?php endif; ?>

Try to further encapsulate your code in functions or even classes. Get as much php out of your pages as possible.



23
I would play the ball right back at the guy. Say you have to finish something for work and if you can't finish it you may loose your job. It will put him in a position of guilt giving you control over the conversation.

Also if you question the morality. I would say its morally justified to lie in that situation since he wants to decieve you into buying stuff you don't need and playing you into that way.

Edit: Deque, it's normal that you can't apply the theory as easy. social interactions are quite complex. and people are also infinitly complex. you will never get the reactions exactly like they are explained. best that theory can make you do is to make you adaptable in such situations.

Pages: 1 [2]


Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.