tech support15

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Saturday, 24 November 2012

Giving a user an anonymous ID programatically

Posted on 05:21 by Unknown
We have a web application written in Java whereby when the users sign in, we want them to be anonymous to each other.  So what we do, is give them a number.  I needed an algorithm to generate the number from their database user id, and I wanted the algorithm to vary such that it wasn't that easy to figure out.

So what I do, is on even days of the month, the user id is added to the day of the month, and on odd month days, I take the absolute value of the day of month - the user id.


//get day of month

int dayOfMonth = cal.get(Calendar.DAY_OF_MONTH);
//cast it to a double so that I can get a modulus 2 which indicates whether it is even or odd
double amem = (double) dayOfMonth;
if ((amem % 2) == 0) {       // it's an even day with no remainder
dayOfMonth = dayOfMonth + userId;
} else {
//its an odd day
dayOfMonth = Math.abs(dayOfMonth - userId);
}


Hope this helps someone.
Read More
Posted in how to give users an anonymous number, java, source code | No comments

Saturday, 10 November 2012

Toshiba Laptop Mouse Won't Work

Posted on 08:57 by Unknown
I was logged in via Remote Desktop to one of my Caribbean servers.  The browser window was being blocked by the Remote Desktop banner or task bar on top of the screen.  I couldn't close it.  So I Googled how to close an application window.  It said to press Alt + F4.

Well on this stupid Toshiba laptop with the weird keyboard, F4 also needs a function key press as well.  The normal key for F4 is to switch display modes when you are connected to a projector.

So I pressed Fn + Alt + F4 and my browser closed.  But I must have let go of the Fn key.  The cursor froze.  The mouse wouldn't work.   I am talking about the mouse on the finger pad.  It is a Synaptic pointing device.  So I shut down the computer and re-started it.  No dice.  I restarted in Safe Mode.  Still had a frozen cursor.  Took out the battery, and re-started it with the last good configuration.  Nada.

I figured that I had blown the drivers.  I went to another machine and did some googling.  It said that Toshiba had a mouse lock. It said to press Fn + F9.  I did.  Nothing happened.  I tried Fn + F4.  My cursor unlocked.

Hope this helps someone.  It sure wasted a bit of my time.
Read More
Posted in frozen, laptop, mouse, Toshiba Laptop Mouse Won't Work | No comments

Friday, 9 November 2012

Virus Free For 5 Years -- Thanks Free Avira

Posted on 10:42 by Unknown


Someone on a forum asked about trojans and viruses.  I posted the following:

My 5 cents on anti-virus:

We needed a computer to act as a server in Nassau. We went to the Radio Shack. It was a Radio Shack in name only. The guy paid the franchise fee and sold whatever he wanted. He was selling a brand new Pentium knock-off complete with Microsoft Office, Adobe Photoshop, Macromedia Director -- everything, The machine was just over $300, and with those software packages, it should have been over $2000.

I brought it back to the office, plugged it in, and every single machine on the network alarmed about spyware, trojans and viruses trying to get in. It turns out the software was crack software from China, embedded with viruses.

The machine was so virus laden, that the browser was hijacked. You couldn't physically go to many anti-virus sites. I download a virus killer onto a USB stick, and ran it from there. That gave me my browser back. But every single machine in the network was still alarming. I used a router to create a subnet to isolate the machine, and I went to work.

We had a bought copy of Norton and MacAfee. That didn't do the trick. We downloaded everything, and still couldn't get a clean machine. I removed all of the software -- Microsoft Office, Adobe Photoshop, everything. Finally there was one free on that worked. It was the free version of Avira out of Germany. I have that on all of my machines today, and it performs wonderfully. It blocks even the most sophisticated attempts to get in.

And then on top of that, I started using Google Chrome exclusively. The infection rate went to zero. 

Since I am a data privacy advocate (I quit Linked In and Facebook), I went to the free Google Chrome store and downloaded tracking cookie blockers. Some of them don't let me buy on Expedia, but when I have to use online shopping and it doesn't work, I temporarily turn them off from icons in the tool bar.

Since I have the free version of Avira, every day I get a huge pop-up with an ad from Avira. I can live with that because it lets me sleep nights. I earn my living with my computer, and I have to protect my digital assets. Speaking of which, you should go to the store, buy a cheap USB key and put your digital books on it. Then put the key in a safety deposit box or in another location other than your house.


I have been trojan and virus free for five years.  Thanks Avira.
Read More
Posted in Avira, malware protection, spywal, The best anti-virus | No comments

Friday, 2 November 2012

Linux Sendmail Not Working

Posted on 09:20 by Unknown
It's real easy to send email using a linux server.  We have an app where we need to send notification details to our users so we send it via the linux server that is already running Apache Tomcat.

Since the details and notifications go beyond the simple, we use java to write the details to a temp file, get the email address from the database, invoke a bash shell to send the mail and then delete the temp file.

Here is how its done.



String messbody = (new StringBuilder(String.valueOf(messbody)))
.append("Please log into www.mydomain.com to see the latest things on your account.").toString();

Then I generate a random file name by assembling a bunch of random characters:

int rancharacter = 65 + (int) (Math.random() * 90);

char ck = (char) rancharacter; 
String fnum = String.valueOf(ck); 

I did the rancharacter many times to generate a random string.  I created a linux directory where this would be written to.  It is in /home/messages.



String longfileName = "/home/messages/" + fnum; 
 File f = new File(longfileName); 
 try {
 BufferedWriter bout = new BufferedWriter( new FileWriter(longfileName)); 
 bout.write(messbody);
 bout.close(); 
 } catch (IOException e)
 { System.out
 .println("Writing email file exception");
 System.out.println("Exception " + e.getMessage()); }

Now that I have a file, I wrote a very little bash script called mailer, put it in the /bin directory and did a chmod so that it could be executed.  The bash script looks like this:


#!/bin/bash
IFS=":-;"
#FILE= "/home/messages/$3"
#echo $(basename "$2")
mail -s $(basename "$2") $(basename "$1") < /home/messages/$(basename "$3")


The only thing life to do, is to create a subject, get the email, get the runtime so that one can execute a linux command, and send the email.

Here's some code:

String emailAddress = email;   //previous declared variable that went to the database
 String subject = "Account_Notification";  //I had to put the underscore to eliminate space problems
 String messBody = fileName; 
 String cmd = "mailer" + " " + emailAddress
 + "  " + subject + " " + longfileName; 
  // get the linux runtime to execute the command
 try { Runtime run
 = Runtime.getRuntime(); Process pr = run.exec(cmd);
 pr.waitFor(); BufferedReader buf = new
 BufferedReader( new InputStreamReader(
 pr.getInputStream()));
 
 } catch (Exception fu) {
 
 System.out.print(fu.getMessage()); } 
 boolean success = f.delete();

OK - all of this was working.  Then I changed the message body and it stopped working.  What caused it to stop working.  In the body of the message, I put java.util.Date.toString();

That would stop Centos linux from mailing.  Weird.  I hope that this helps someone.



Read More
Posted in date, failing, how to send mail with linux, java, linux, sendmail | No comments
Newer Posts Older Posts Home
View mobile version
Subscribe to: Posts (Atom)

Popular Posts

  • C# .NET Textbox GotFocus Event
    When one Googles to find out sample code for a C# .Net textbox gotFocus() event, the first few search results are not that explicit.  So wit...
  • Mechanized Attack Detection Algorithms
    I was on a CNN sub site and they were talking about security and threat of attack. One of the types of attacks that they were profiling, wa...
  • More Reasons Why To Quit Facebook and LinkedIn
    Man, I am looking smarter and smarter every day for quitting Facebook and LinkedIn. Can you imagine that your credit rating will suffer for...
  • Exception in thread "Thread-0" org.eclipse.swt.SWTException: Invalid thread access
    So you are getting your feet wet with Java SWT and you are having trouble updating your UI while you are doing some heavy processing.  Perha...
  • Is Android Safer Than iOS for Mobile Banking?
    First of all, total disclosure:  I am a registered Apple, Android and Nokia developer.  I have no real preferences.  There are good and bad ...
  • Java Networking
    I have this issue where I need to know the IP address or some identifying part of a computer.  Using Java, I came across the class of java.n...
  • It's Time -- A New Plug-in Filter for Browsers Needed
    I am starting to get a little ticked off at how much data is being collected on me when I surf the internet. Websites often ask for authent...
  • Classmates.com -- Another MySpace in the Making?
    A few years ago, I signed up on Classmates.com. I did it out of pure curiosity to find out where my peers in high school ended up. I enrol...
  • IE Users are Stupid, and Microsoft Knows it.
    (Click on the pic to make it larger) I have several email accounts. One of them is Hotmail. When I sign out of Hotmail, I usually land in ...
  • Facebook -- Dead Man Walking
    A couple of years ago, it would have been heresy to say that MySpace was irrelevant. It is now a ghost of what it was, and it IS irrelevant....

Categories

  • .avi
  • .Net
  • .wmv
  • [ERROR] /usr/share/mysqld: Out of memory (Needed xxx bytes)
  • activity with webview
  • ad
  • ads
  • adsense
  • Advanced UX
  • advertising how-to
  • algorithms
  • amazon
  • amenities
  • analysis
  • analyzing emotions in speech
  • android simulator
  • Anonymous email
  • anti-terrorist in cyberspace
  • apache
  • app
  • Apple
  • Apple Developer Site Down
  • apps
  • apps listing
  • arraylist
  • arraylist of arraylists
  • Artificial Intelligence
  • Arvind Bhatia
  • assholes
  • Avira
  • Aviva Premiership
  • background color
  • Bahamas
  • baidu
  • bait and switch
  • bash
  • basics
  • Bayesian inference
  • best blogging software
  • best free mobile web template
  • best iso image burner
  • Best Practices
  • best remailer service
  • big brother
  • big data
  • binaries
  • black hole net
  • blackhat SEO
  • block ip addresses
  • blog comments
  • blog design
  • Blogger
  • blue screen
  • bogus
  • Bombing
  • book covers
  • bookmark
  • Boston Bombing
  • Boston Marathon
  • browser
  • browser plugins
  • browser wars
  • browsing history
  • buddhist of the binaries
  • bug
  • Build 7600
  • Business Intelligence Cubes
  • C Sharp
  • c#
  • C# .NET Textbox GotFocus Event
  • cable
  • call center software
  • Camden Hughes
  • Can not issue data manipulation statements with executeQuery()
  • can't see Android Device
  • cannot upload image
  • Carl Jung
  • Casey Anthony
  • Caylee Anthony
  • censorship
  • changing revenue paradigms
  • charging
  • check LinkedIn Password
  • China
  • chinese investments
  • Chinese Search Engine
  • Chrome
  • chrome extensions
  • classes folder empty
  • classmates.com
  • clear on focus
  • clearmeter.com
  • click and clear input
  • closure
  • CNN
  • combating terrorism
  • comm.jar
  • comm3.0_u1_linux
  • command line
  • compiled
  • computer trading algorithm
  • computer virus
  • conciousness
  • connection pool
  • connection pooling
  • conspiracy theories
  • consulting
  • content analysis
  • content management systems
  • convert avi to dvd
  • convert dvd to avi
  • convert Gregorian Calendar to DateTime using Timestamp
  • converting Twitter followers to web hits
  • cookie monster
  • coolutils.com
  • copyright dispute
  • corrupt data
  • crap software
  • crash
  • create iphone app
  • css
  • current datetime
  • cyberspace counter terrorism
  • dark knight
  • dark web
  • Data Cleansing
  • data mining
  • data privacy
  • Data Refinery
  • data storage
  • datamining
  • date
  • date time manipulation
  • day trader
  • day trading
  • daytrader
  • daytrading
  • dead batman
  • dead man walking
  • decline of desktop
  • declining membership
  • delete database duplicates
  • delete duplicate rows
  • derek medina wife photo
  • determining user behind browser history
  • develop iPhone apps
  • developer
  • Developer website
  • development
  • dialog
  • dialog won't open
  • dictionary of apps
  • difference
  • digital buddha
  • disconnect.me
  • discountApp browser hijack
  • divx codec
  • Divx codec pack
  • DNA and information storage
  • DNSChanger Malware
  • do not track plus
  • domain name
  • domain name works
  • double quote
  • Download jfaces jar
  • drop Image
  • dumb ass
  • Dummies Guide to UIX
  • dvd
  • Eclipse
  • eCommerce
  • editor
  • Effective ways of fighting SPAM
  • Elliott Wave
  • end application
  • ePublishing
  • ereader
  • error
  • escape ampersand
  • Escape Key
  • exam for software developer
  • example
  • excel
  • Excellent
  • Exception in thread "main" java.lang.NoClassDefFoundError:
  • EXP/CVE-2012-0507
  • exploit
  • extreme software techniques
  • extreme UX
  • Facebook
  • facebook fair valuation
  • Facebook fatigue
  • facebook ipo
  • Facebook stock
  • facebook true share price
  • facebook true stock price
  • fail
  • failing
  • failure
  • fake traffic hits
  • faking domains
  • fast forward button for browser
  • fault tolerance
  • file splitter
  • file too big for email
  • find apps
  • Firewall Rules
  • firmware embedded in DNA
  • fly-half
  • Form not visible in task bar
  • format telephone number
  • formula doesn't work
  • forums
  • free
  • free email
  • free file splitter
  • free iso burner
  • free template
  • freedom of speech
  • frozen
  • funny
  • fuzzy class
  • fuzzy logic
  • Galaxy
  • geek gossip
  • gerard depardieu
  • get date from timestamp
  • get minutes
  • get remaining minutes between two dates
  • get rid of characters in a number
  • get rid of unwanted characters
  • ghostery
  • gmail
  • good stuff
  • google
  • google ads
  • Google Chrome
  • Google Chrome Browser Blocker
  • Google Circles
  • Google Image Search
  • Google+
  • gramlets
  • great stuff
  • GSM modem
  • hacked
  • hacked LinkedIn Password
  • hackers
  • Handling large amounts of data
  • Hard disk corruption
  • hardware
  • hashtag
  • hot trends
  • how computer games will evolve in the future
  • how do copy a form
  • how google image search works
  • how to build an iphone app
  • how to deal with spammers
  • how to develop iphone app
  • how to duplicate a form
  • how to get a company website quickly
  • how to get rich by writing apps
  • how to get venture capital
  • how to give users an anonymous number
  • how to make an effective online ad
  • how to redirect
  • how to see directory
  • how to send mail with linux
  • how to validate
  • html
  • html input
  • html input tag
  • html tag
  • html tags
  • human garbage
  • hunting terrorists through technology
  • I/Choreographer (xxxxx): Skipped 60 frames! The application may be doing too much work on its main thread.
  • icefaces
  • IDE
  • IE users stupid
  • IE9
  • if browsers were guns
  • imperfect clues
  • In order to select an image from your online storage
  • increase maximum number of open files
  • increase mysql memory size
  • inexact computing
  • innovative uses
  • intelligence test
  • interest engine
  • interesting problem to solve
  • Internet
  • Internet explorer
  • Internet Explorer 10
  • Internet Explorer 8
  • Internet Privacy
  • invalid server's version String Tamirsharpssh
  • investing
  • Invoke or BeginInvoke cannot be called on a control until the window handle has been created
  • iOS
  • iOS 7.1 beta
  • iOX
  • IP addresses for Iran
  • iPad
  • iPhone
  • iphone app
  • iphone apps development
  • ipo
  • is facebook dying
  • is the google search engine concious
  • IT
  • it consulting
  • it jobs
  • java
  • java 8
  • java.lang.ClassNotFoundException:
  • java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51.0
  • java.sql.SQLException: After end of result set
  • java.util.date
  • javascript
  • javax.servlet.ServletException: java.lang.UnsupportedClassVersionError Unsupported major.minor version 51.0
  • JdbcOdbcDriver.finalize() line: not available
  • JNDI
  • job test
  • join three tables
  • JSF
  • jsp
  • Julianne McCrery
  • Jungian view of the computer
  • keylistener
  • kill application
  • killer robot
  • kindle
  • Kyron Horman
  • lamda
  • laptop
  • launchrock.com
  • learn to program
  • Leicester Tigers
  • libmysqlclient.a
  • Linkedin
  • linking interests to content
  • linux
  • list directories
  • localhost
  • login
  • login before proceeding to page
  • looking for work
  • Mac
  • macbook Pro
  • mail
  • mailer
  • make iphone app
  • making money with photoshop
  • malware
  • malware protection
  • man on roof
  • Mandelbroatian math
  • mango
  • Mark Zuckerberg
  • massively parallel systems
  • Mathematical Modeling Regression
  • mechanized attack detection
  • Merry Christmas
  • meta tag
  • micro programs
  • microsoft
  • microsoft codec
  • microsoft codec doesn't work
  • microsoft is crap
  • microsoft spam tabloid national enquirer
  • Microsoft sucks
  • Minimum Viable Product
  • missing data
  • missing information
  • mistakes
  • mobifreaks.com
  • mobile
  • mobile web tags
  • moderator
  • monetization
  • monetize social media
  • monetizing social media
  • most popular Browser
  • most popular Operating System
  • mothers who kill
  • mouse
  • mouse is dead
  • movie files
  • Multi-Layer-Perceptrons
  • mute button for browser
  • myevent.com
  • myspace
  • mysql
  • mysql client
  • mysql error
  • navigate
  • needed. Structure Query Language
  • network interface
  • Neural Nets
  • new paradigm
  • new SQL functions
  • New Version of Xcode available
  • Nigerian Scam
  • no black screens
  • nokia
  • nokia developer
  • nokia website hacked
  • non-cloud cloud
  • non-compatible
  • nook
  • numbers game
  • OCR
  • offshore software development
  • old technology
  • online
  • open source
  • org.apache.catalina.loader.DevLoader
  • org.eclipse.swt
  • out of memory
  • pages unresponsive
  • parallel computing
  • parallel executables
  • parameter
  • partnership
  • pattern recognition
  • PDF to Word
  • pee on a plane
  • Perfect Web Page
  • performance analysis rugby
  • Perils of Python
  • phone
  • PhotoResize400.exe
  • photos
  • photoshop
  • PHP
  • picture
  • please sign in
  • plugin
  • predictions
  • predictive analysis
  • preventing hack attacks from the Middle East
  • privacy
  • privacy concerns
  • privacy policy
  • problems
  • problems with Microsoft
  • product review
  • programlets
  • programmers in paradise
  • protect yourself
  • punch clock
  • python programming language
  • quant
  • quit facebook
  • quit linkedin
  • Randi Zuckerberg
  • RapidShare
  • RapidShare.com
  • readability
  • real life
  • real UIX
  • reddit
  • redirect
  • refresh
  • remailer
  • rename
  • resize
  • rest in pieces
  • revenge
  • review
  • rise of mobile
  • risks
  • rocketmail
  • roller
  • rough order of magnitude
  • round number to nearest 100
  • row_count()
  • rugby
  • rugby analysis
  • rugby performance
  • RugbyMetrics
  • rules engine
  • running PHP on Tomcat
  • sabermetrics
  • sabremetrics
  • sample
  • Samsung
  • samsung galaxy usb device not recognized
  • satellite
  • scam
  • scan
  • schedule
  • scouting
  • scouting tools
  • script
  • scum of the earth
  • scumbag
  • Search Engine
  • security
  • Seed
  • select results into a file
  • select tag
  • semantic web
  • send email anonymously
  • send sms
  • sendmail
  • SEO
  • serial port
  • server hangup
  • set select
  • set the select of a combo box
  • sharp
  • sharpssh
  • shell
  • shift in consulting
  • show line numbers
  • silicon
  • SIM car
  • single quote
  • skype
  • skype crashes xp
  • skype is crap
  • skype virus
  • sms
  • sms spam
  • social media
  • soft censorship
  • software
  • software algorithm required
  • software bug
  • software emotionally aware
  • software in bugs
  • software job
  • software to capture emotion
  • Solve a tricky problem
  • sony
  • source code
  • spam
  • spammers
  • split a .war file
  • split war file
  • spreadsheet
  • spying on the internet
  • spywal
  • SQL
  • sql tip
  • ssh
  • SSL connection error
  • standard
  • start process at specific time
  • start-up web presence
  • startup
  • startups
  • statistic problem
  • statistics
  • stock manipulation
  • stock price
  • story
  • string
  • string error
  • strip out characters from a number
  • subtract dates
  • sucks
  • sunset
  • Surface
  • SWT
  • Tablet
  • tech support
  • technical test
  • technical trading
  • technology
  • template
  • ten things to get venture capital
  • Terri Horman
  • text spam
  • The best anti-virus
  • The Fastest And Slowest Emails among the big free providers
  • The feature you requested is currently unavailable. Please try again later.
  • the first noble truth
  • The Future of Online Games
  • the ish function
  • the menu supervisor
  • The most effective way to generate hits
  • the next big thing
  • the next big thing in computing
  • The Real Social Network
  • the zen of software development
  • thin slicing
  • This Copy of Windows is not genuine
  • thread
  • Thread: java.net.SocketException: Too many open files
  • thumb-driven menus
  • time comparison
  • Timestamp
  • tip
  • to front
  • toby flood
  • today comparison
  • today() function
  • tomcat
  • tomcat won't start
  • too old for IT job
  • top secrets of the admasters
  • toshiba
  • Toshiba Laptop Mouse Won't Work
  • total privacy
  • totally distributed software
  • tracking cookies
  • traffic faker
  • trends
  • true stock price
  • true value of facebook stock
  • Turing Test
  • twitpic
  • Twitter
  • twitter follow back
  • ubuntu
  • UIThread
  • UIX
  • UIX for Dummies
  • ulimit Hn Sn
  • Ultimate Web Page Design
  • Ultra data privacy
  • unavailable
  • Uncaught ReferenceError: $ is not defined?
  • Uncaught SyntaxError: Unexpected token ILLEGAL
  • unemployed
  • unmoderated
  • update
  • update UI
  • Upgrading SQL
  • url
  • usability
  • usb
  • usb modem
  • User Experience
  • User Interface Experience
  • validating data
  • valuation
  • variable
  • vi
  • video
  • viewing
  • vim
  • vimeo
  • virus
  • Virus domain
  • visual comparison
  • Visual studio
  • vpn connection
  • Walmart
  • war file
  • warning
  • Warren Buffett
  • web page development tip
  • web-based email
  • website doesn't work
  • website errors
  • website traffic
  • Webview
  • Western Digital SmartWare Review
  • what the chinese are searching for
  • where facebook stock will end up
  • who was at the computer
  • Windows 7
  • Windows 8
  • Windows Tablet
  • won't build
  • won't turn off
  • won't turn on
  • word filtering
  • www doesn't work
  • xcode tutorials
  • xhtml
  • Yahoo
  • yahoo copies gmail
  • yahoo mail
  • You have logged out from another location. Do you want to log in again
  • youtube
  • амперсанд

Blog Archive

  • ►  2013 (82)
    • ►  November (8)
    • ►  October (18)
    • ►  September (10)
    • ►  August (10)
    • ►  July (11)
    • ►  June (9)
    • ►  May (2)
    • ►  April (6)
    • ►  March (6)
    • ►  January (2)
  • ▼  2012 (115)
    • ►  December (9)
    • ▼  November (4)
      • Giving a user an anonymous ID programatically
      • Toshiba Laptop Mouse Won't Work
      • Virus Free For 5 Years -- Thanks Free Avira
      • Linux Sendmail Not Working
    • ►  October (15)
    • ►  September (8)
    • ►  August (14)
    • ►  July (12)
    • ►  June (14)
    • ►  May (19)
    • ►  April (12)
    • ►  March (4)
    • ►  February (2)
    • ►  January (2)
  • ►  2011 (59)
    • ►  December (2)
    • ►  October (1)
    • ►  September (8)
    • ►  August (6)
    • ►  July (8)
    • ►  June (10)
    • ►  May (13)
    • ►  April (11)
Powered by Blogger.

About Me

Unknown
View my complete profile