Tuesday, January 30, 2018

Programming: GUI with wxHaskell

So recently I have been getting back into some programming, and I figured messing around with a GUI would make me feel a little more accomplished. So to keep things simple, I made a temperature converter because it's simple and the documentation for wxHaskell is a bit hard for me.

I'm sure my design is absolutely terrible, but it works. Feel free to complain about my design. At the very least, it shows how to use a few components. If I get some time I may create something that shows as many components as I can work out.

Sunday, January 7, 2018

Cabal install of wxHaskell CBool Error

So recently, I have been trying to dive back into programming with a little more oomph than a one-off project. I figured setting up a GUI along side would help keep me motivated. Now my current computer is an older Mac Book Pro because it is one of the few laptops in the house with a working battery. After diving around a large amount of fluff without any real substance, I decided going with wxHaskell would be the better choice. So I made sure wx was installed and did a cabal install wx, and wouldn't you know it that it failed.

src/haskell/Graphics/UI/WXCore/WxcTypes.hs:752:20: error:
    Ambiguous occurrence ‘CBool’
    It could refer to either ‘Foreign.C.CBool’,
                             imported from ‘Foreign.C’ at src/haskell/Graphics/UI/WXCore/WxcTypes.hs:126:1-16
                             (and originally defined in ‘Foreign.C.Types’)
                          or ‘Graphics.UI.WXCore.WxcTypes.CBool’,
                             defined at src/haskell/Graphics/UI/WXCore/WxcTypes.hs:750:1
752 | toCBool :: Bool -> CBool
    |                    ^^^^^

src/haskell/Graphics/UI/WXCore/WxcTypes.hs:755:22: error:
    Ambiguous occurrence ‘CBool’
    It could refer to either ‘Foreign.C.CBool’,
                             imported from ‘Foreign.C’ at src/haskell/Graphics/UI/WXCore/WxcTypes.hs:126:1-16
                             (and originally defined in ‘Foreign.C.Types’)
                          or ‘Graphics.UI.WXCore.WxcTypes.CBool’,
                             defined at src/haskell/Graphics/UI/WXCore/WxcTypes.hs:750:1
755 | withBoolResult :: IO CBool -> IO Bool
    |                      ^^^^^

src/haskell/Graphics/UI/WXCore/WxcTypes.hs:760:14: error:
    Ambiguous occurrence ‘CBool’
    It could refer to either ‘Foreign.C.CBool’,
                             imported from ‘Foreign.C’ at src/haskell/Graphics/UI/WXCore/WxcTypes.hs:126:1-16
                             (and originally defined in ‘Foreign.C.Types’)
                          or ‘Graphics.UI.WXCore.WxcTypes.CBool’,
                             defined at src/haskell/Graphics/UI/WXCore/WxcTypes.hs:750:1
760 | fromCBool :: CBool -> Bool
    |              ^^^^^

src/haskell/Graphics/UI/WXCore/WxcTypes.hs:763:55: error:
    Ambiguous occurrence ‘CBool’
    It could refer to either ‘Foreign.C.CBool’,
                             imported from ‘Foreign.C’ at src/haskell/Graphics/UI/WXCore/WxcTypes.hs:126:1-16
                             (and originally defined in ‘Foreign.C.Types’)
                          or ‘Graphics.UI.WXCore.WxcTypes.CBool’,
                             defined at src/haskell/Graphics/UI/WXCore/WxcTypes.hs:750:1
763 | foreign import ccall "intToBool" intToCBool :: Int -> CBool
    |                                                       ^^^^^

src/haskell/Graphics/UI/WXCore/WxcTypes.hs:764:48: error:
    Ambiguous occurrence ‘CBool’
    It could refer to either ‘Foreign.C.CBool’,
                             imported from ‘Foreign.C’ at src/haskell/Graphics/UI/WXCore/WxcTypes.hs:126:1-16
                             (and originally defined in ‘Foreign.C.Types’)
                          or ‘Graphics.UI.WXCore.WxcTypes.CBool’,
                             defined at src/haskell/Graphics/UI/WXCore/WxcTypes.hs:750:1
764 | foreign import ccall "boolToInt" cboolToInt :: CBool -> Int
    |                                                ^^^^^
cabal: Leaving directory '/var/folders/8_/gbh6jvpj5dng4lmty_f9bjwh0000gn/T/cabal-tmp-50540/wxcore-'
cabal: Error: some packages failed to install:
wx- depends on wx- which failed to
wxcore- failed during the building phase. The
exception was:
ExitFailure 1

So with that big mess, it was time to hunt for what to do. With any luck this will be fixed soon because I generally have very little idea of what I'm doing. So the first step was to see if there was an alternative without manual intervention. Nope. So, I downloaded the package that was having the problem.


Then we extract and open up src/haskell/Graphics/UI/WXCore/WxcTypes.hs and edit line 127 to

import Foreign.C hiding (CBool)

Save the file, open up a terminal. Navigate to the wxcore- folder and run

cabal install

After it hopefully succeeds, which it did for me, just simply

cabal install wx

I hope this helps anyone that needs and that the need doesn't last too long. I came across someone mentioning this fix on Stack overflow I think, but I can't find the link to it and don't plan to search too hard for it.

Saturday, December 30, 2017

Tech Review: Asus RT-AC3100

After finally getting fed up with my old router dropping devices, locking up, and corrupting firmware, I decided to get a new one. Working in IT, one would think I had a good idea of what to get, but I only had a list of brands in my head to avoid. So off to the Googles for lists of good routers. I came across some various Asus routers and figured I would check their site for what they have to offer. Generally my goal is to go for a newer device to avoid upgrading for as long as possible. In this case, it was a matter of I need something that also works well.

So after a same day in store pick-up, it was time to set up a brand new router. So as far as basic setup to get going, it was so simple and quick that I don't remember any of it. Seriously, it was simple with a fully guided setup. For me, that's too boring. After it was setup, it was time to fine tune and update. The control panel for this is nice, however setting IPs manually is very annoying and was hard enough to find where to do it. There is also a rather bad disconnect between what you can do with the phone app for it and what you can do on the actual control panel.

When it comes to security, it has a guided scan for that, making it easy enough to lock down the features. The one thing that annoyed me is that if you don't go through the security stuff, it has a lot of outside access enabled. I turned off all of the dydns stuff and it's actually in its own NAT anyway, so that won't work. Reason for that is I have a business class router that gives me four separate networks I could configure, but I just use one and only really have it because I use too much internet. As far as all the security options, a quick run through is:

  • Change default login
  • Strong wifi password (mine is way too long but it keeps others from learning it)
  • Wireless encryption
  • WPS disabled
  • Ping from WAN disabled (doesn't do much in my case because the WAN is a private network)
  • DMZ disabled (WAN is private, so not much of a problem either way in my case)
  • Port trigger disabled
  • Port forwarding disabled (If you lock down your device, this doesn't matter too much)
  • Anonymous login to FTP disabled (I keep FTP disabled as a whole because it's plain text, they need to add SFTP)
  • Disable anonymous login to network shares
  • Malicious website blocking enabled
  • Vulnerability protection enabled
  • Infected device prevention and blocking
These are all good things, especially when you share a network or even have kids using it. My niece was using her new laptop she got for Christmas while she was over and I noticed she clocked on an ad which took her down a string of fake search engines. I feel having a safe network both outside and in will be quite necessary in the not so distant future.

The parental controls on this seem quite simple, I have not tested to see what catches them though. I'd imagine that I'd trip off parental controls quite often. The options are to block porn, violence, gambling and illegal stuff (sounds like a good weekend to me), messengers, social media, file sharing and streaming. Basically everything that runs into either age restrictions or COPPA.

Now the QoS stuff is my favorite. It doesn't do much on a not so heavily used network, but it has all the monitoring stuff there for you to view. It's very basic in controls and I don't know how much of an impact ia will have, but games and streaming are high priorities for me, so that's the gist of my setup. There's also further information in a traffic analyzer that can give some more insight into individual device usages.

A feature I have setup and plan to use quite a bit is the samba share. I have a 2TB external that I keep for backups, but since it is NTFS that can cause some problems. Luckily, every modern device known to man now seems to support samba, so we can dance the night away with some file transfers. I have noticed that while trying to move files off of a time machine to the hard drive, it times out quite often. I think that's just a culmination of other problems and aging hardware. You can isolate file permissions, but keep in mind that the router login will have full access to everything. You can remove its access but when I tried that, everything came apart at the seems. I couldn't write to the drive.

One feature I have enables that I think will prove to be very useful is the IFTTT options. I have my phone text me when someone connects to the network. One major security hole I see though, is the Alexa support. When you can voice command your router to do things like turn on a guest network or even administration stuff, that just seems like poor design. Voice recognition is not secure, so why add it to something you are trying to keep secure?

The last feature I want to touch on is the mobile app. It works. It's not great. It makes a good monitoring tool and the family feature lets you group devices together per person to either check their usage or quickly block someone entirely from the network. You can check on things and do some basic tasks quickly. I personally want more, but I can't fault it on that. I fault it on the fact that some mobile features are not available on the control panel as far as I can find and the same goes the other way. This is the disconnect.

I could go on for quite a while point by point with features and such, but the rest are boring. So quick overview: firewall, url filtering, keyword filtering, dual wan with fallback and loadbalancing, 3g/4g through usb devices, ipv6, vpn, WTFast integration, ssh (yay!), telnet (why?!), ping, traceroute, and nslookup. There are probably other things I missed, but whatever.

So, coverage and reliability. I live in a small house that was not designed with networking in mind. This router is made for large area coverage. My signal goes all over mu .98 acres and beyond. I have no idea where the signal ends. I have not had a device drop off for the two days I've had the router, but here's the thing. There is the AC88U that is the same 3100 class router, but with an extra network card that has 4 more ports. That one has a lot fo complaints about it just suddenly not working or things dropping off. I imagine it's a bit of user error and a bit of hardware not playing nice. This is just a guess. There were fewer complaints about that on this router, and by fewer I mean enough to chalk up to purely user error, mishandling, or actual defects on those specific devices. So I'm confident that it will hold up fine.

Now for the conclusion. Yes I would recommend it to others, even the less tech-savvy. In fact, I think it was made for the less savvy with a few bones thrown for the more technical minded. I've personally never had a problem with Asus before, but I have had problems with some of the pairings with Asus. So until the router decides to go down in a blaze of glory, I'd say it's a good deal. It's not cheap, but seeing as it is the only device that will be the backbone of most people's home network, it's something you should spend a little extra on.

Now for some after stuff of my network. I got a business class router/modem thing from Xfinity that I'm not going to check what the model is because that requires getting up. I just use one port right now that goes to the router. The router goes off to a very old switch that goes to everything else in the house. I have a newer switch, but that is in the office right now because I was working on stuff but then the RAM died and I'm too cheap and lazy to replace it right now. One of the ethernet cords goes to the entertainment center, which has an old time machine acting as a switch because reasons. I need a couple of new switches, but I'm too cheap to mess with what seems to work for now. The old switch is an HP procurve 8 port managed piece of junk and the newer one in the office is an unmanaged Cisco 8 port. I got the managed one to mess around with vlans, but I don't have anything that has a reason for that, so that's just me taking ideas from work home with me for no reason other than it's fun. Eventually I will do everything all proper, but for now it works.

Monday, October 23, 2017

Tech Review: Rexing V1P

Due to driving an hour to get to work, an hour to get home, and drive between buildings at work, I supposed it best to get a dash cam. Not to mention getting rear-ended on my way in to work not more than a few months ago. So after browsing around, I settled on the Rexing V1P for the low price and additional rear camera. I got the camera itself without doing real in-depth research, a fatal flaw of mine to jump on a reasonable price and good ratings. So here's my review after a week of owning one.

The first thing to note is that you need loop recording enabled because after an email from Rexing, you can only have a 4GB single file, which is roughly 40 minutes. No major drawback there, and having the separate 10 minute files is easier to find events. If you let it hit the 4GB file, it tells you the SD card is full and stops recording. I was also advised to avoid a SanDisk Ultra SD card, after I bought one with it because Amazon recommended it. So far, I haven't had any real problems with it, but I figured I would mention it. They recommend some Lexar SD card.

So the part I think is most important, is installation. I've now installed one in a 2010 Toyota Prius and a 2016 Toyota Rav4. Installation itself is super easy, I just did the normal charger as apposed to a hardwire because I'm still a little nervous about what the actual impact would be as far as the fuses itself and I already hard to replace a fuse for a plug and USB adapter. Now the installation was very easy, but of course it depends on your car. With both cars, I was able to pull paneling away and pop the gasket out of the runs to get the wires behind everything, including behind the airbag. I was worried if I put it in front of the airbag, it could cause a problem. To drop the power to a plug, I dropped it behind the glove box where there's already an exposed hole. To get the rear camera wire from door to door required getting a rigid wire and some tape.

To attach the front camera, rather than stick it on the windshield and worry about the 3M pad getting wrecked by the sun and heat in Georgia or needing to replace it if the windshield needs to be replaced, I bought the suction cup mount. All seemed well, but there was one final problem. My windshield has a low angle and I'm over 6ft tall. The screen has a low angle viewing and I can only seem to manage a high angle.

Despite the random problems I've run into, I've been very happy with the camera. Now I'll tack on some video for the front and rear with an example of why I need a dash cam. I pulled some clips from the front and rear for both the daytime and night/early morning.

So as a final rating for the dash cam... I would say it's great for the price with a simple install.

Tuesday, October 10, 2017

Tech Review: Denon AVR-S530BT

So, recently in the process of moving stuff from an entertainment center into one built into the backside of a closet, the failing sound system that was previously being used failed completely. It was just turning itself off at random, but now it just says "Overload" and turns off. So began the quest to find a cheap replacement that would require as little effort as possible. And that meant me not having to run new speakers or mount anything again or make cable ends.

So the first step of the quest took me to Amazon, where I was spectacularly disappointed by the prices and offerings. I have a limited budget with plenty of unexpected costs and just spent around $100 punching a hole in the wall for the start of this project already. So I decided to go on to Google and Best Buy came up as the top result. Personally, I have been avoiding Best Buy because the majority of the store just seems like a bad joke to me. My in-laws have had their crews install systems for them to be given an unmanageable mess.

You see, I have very simple standards. Get from A to B in as few steps as possible. I don't want to turn on the TV, then a system, then the sound, then select the input. I use HDMI control so that I turn on a device, it turns on the TV, the TV then routes the sound via S/PDIF optical and I didn't have to do much of anything. Now I digress back to the quest.

Upon looking at Best Buy, they had a Denon AVR-S530BT for like $250 with the right inputs and outputs I needed to do as little work as possible. The price and the effort plus a rating above 4 stars was an instant sold! By now you should realize, I didn't read up on any of the features or specs. You see, as long as the sound isn't too much treble or bass when I get it adjusted, I'm fine. Seriously, people that just crank up the bass as high as it goes to "show off" their sound system piss me off. You need to balance the bass and treble.

So fast forward to the system being home and installed. First thing to get out of the way, the auto setup is a piece of trash. It did not work. At all. That being said, the sound system works and it sounds just fine. So, let's fast forward to the features found on it.

First thing I noticed was that it was connected with an HDMI cable as well. Could it be? Could I finally have gotten a sound system that turns itself on and off with the TV and use the TV remote for volume control? In the settings I found HDMI Control, turned it on and we were in business. So the TV turns it on, off, and adjusts the volume.

The next thing to notice was the bluetooth options. That means I can play music from a phone without turning on the TV. That's okay and all, but the more interesting part was that it has a bluetooth remote control. That makes it even more worth it since my phone is generally within arms-reach... unless someone may be calling, then it's in another room where I can't hear it.

Another added benefit to the sound system is the HDMI ports on the back. The TV has long since been out of HDMI ports, but with the extra ports it is now like having even more ports! Some other features I don't really care about them being there are an AM and FM radio.

The main point and conclusion on the device it that it works well and at the price, you really can't beat it. I'd say it's a great value.

Tag Cloud

.NET (1) A+ (1) addon (6) Android (3) anonymous functions (5) application (9) arduino (1) artificial intelligence (2) bash (3) c (7) camera (1) certifications (1) cobol (1) comptia (2) computing (2) css (2) customize (15) encryption (2) error (15) exploit (13) ftp (2) gadget (2) games (2) Gtk (1) GUI (5) hardware (6) haskell (15) help (5) HTML (4) irc (1) java (5) javascript (20) Linux (18) Mac (4) malware (1) math (8) network (5) objects (2) OCaml (1) perl (4) php (8) plugin (6) programming (42) python (24) radio (1) regex (3) security (21) sound (1) speakers (1) ssh (1) telnet (1) tools (11) troubleshooting (1) Ubuntu (3) Unix (4) virtualization (1) web design (14) Windows (6) wx (2)