Category Archives: Linux

How to install nmap / netcat on Boot2Docker

boot2docker uses tinycorelinux ( tiny core linux ) for it’s base image – and it is just that – tiny. If you want to add in utilities, you’ll need to use tce-load because this distro doesn’t have apt-get install / aptitude install or yum install What they have instead is tce-load – some information can be found on their install apps page To install nmap you can run: tce-load -wi nmap.tcz I did not see netcat listed on the packages page but I was able to install socat which does the same things as netcat tce-load -wi socat.tcz

Posted in Linux | Leave a comment

How to tell if PL-2303HX ( PL-2303 ) is 3.3v or 5v

If you have a USB adapter and would like to use it when working with Arduino or Raspberry Pi you may wonder if it is safe to use with a 3v3 system. Purchasing these on eBay can be cheaper than buying from someplace like Adafruit but the listings often have no documentation on if the chip can be used with 3.3v devices. You can measure some of the pins to make your own determination. The unit I was working with several pins labeled: I measured voltage between the GND pin and the TX pin which gave around 1.8 – 2.5V without any data being transmitted. When I sent data to the device the voltages went intermittently to around 3.3 volts or maybe 3.4 volts. But I wanted to make sure that the chip was actually setup for 3.3v and so I found the datasheet for the PL-2303HX Make sure to get the correct datasheet for the chip you have – some of the chips are slightly different, like the HXD version. On page 11 of that datasheet it showed the pinout diagram – notice the small circle indicating “pin 1” which should correspond to the small dot on the actual chip: Pin 4 is labeled VDD_325 and the note says: RS232 VDD. The power pin for the serial port signals. When the serial port is 3.3V, this should be 3.3V. When the serial port is 2.5V, this should be 2.5V. The range can be from 1.8V~3.3V. Use this information at … Continue reading

Posted in Linux | Tagged , , | Leave a comment

Solved: linphone: error: libupnp >= 1.6 < 1.5 required.

If when attempting to compile linphone you get this error when running ./configure – error: libupnp >= 1.6 < 1.5 required. Then you can try what L Miller suggests and do: apt-get remove libupnp4-dev And then: apt-get install libupnp6-dev This seems to do the trick when compiling on Ubuntu 14.04. After upgrading this library I started over in the compiling instructions with autogen: – Compile linphone $ ./ $ ./configure $ make && sudo make install $ sudo ldconfig If that still doesn’t work then see

Posted in Linux, Software | Tagged , | Leave a comment

How to setup cPanel on Amazon EC2 with Centos 6.4

I had a lot of problems setting up a cPanel server on Amazon EC2. On my first attempt I used a CentOS image from the AWS marketplace but using one of these images has a very bad side effect of not being able to resize, clone, and/or mount the root file system to another instance ( think about the issues with data recovery or fixing an un-bootable ec2 instance – yuck ) – this is what dgFactor is referring to in his comment My next attempt I had launched the instance but after it was launched cPanel would not install, giving errors similar to: [20130131.123334] Setting up Install Process [20130131.123334] No package wget available. [20130131.123335] Nothing to do [20130131.123339] E Sysup: Needed system RPMs were not installed: wget [20130131.123339] ***** FATAL: Cannot proceed. Needed system RPMs were not installed. [20130131.123339] The Administrator will be notified to review this output when this script completes [20130131.123339] E Detected events which require user notification during updatenow. Will send iContact the log => Log closed Thu Jan 31 12:33:39 2013 [20130131.123339] E Running `/usr/local/cpanel/scripts/updatenow –upcp –log=/var/cpanel/updatelogs/update.1359657200.log` failed, exited with code 4608 => Log closed Thu Jan 31 12:33:39 2013 What seems to have happened here is that the file system was full. Even though I had increased the default drive size from 5GB to 40GB when the system booted the additional space was unavailable: This can be confirmed from SSH after connecting to the instance: [[email protected] ~]# df -h Filesystem Size Used Avail Use% … Continue reading

Posted in Linux, Server Administration | Tagged , | Leave a comment

Install mitmproxy from source on Ubuntu

If you want to live on the dangerous side, you can install mitmproxy from its master branch. If you encounter any bugs, please do us the favor and report them on the Github issue tracker briefly. Install from source using PIP pip uninstall mitmproxy netlib pip install git+[email protected] pip install git+[email protected] Install from source on Ubuntu Installing mitmproxy master from sources on stock Ubuntu – first uninstall using: pip uninstall mitmproxy netlib Now install the required tools: $ sudo apt-get install -y build-essential libssl-dev libffi-dev python-dev python-pip libxml2-dev libxslt-dev git Now install with sudo: $ sudo pip install git+[email protected] $ sudo pip install git+[email protected] Now start up a python console and paste in these two commands – this is a workaround for issue 32 : $ sudo python # >>> from netlib import certffi >>> exit() Source: github gist

Posted in Linux | Tagged , , | 1 Comment

Hide “You can search from here with Google” in Chromium

If you’re running chrome in kiosk mode Google Chrome, or Chromium, or even if you are not using kiosk mode, you may have encountered the nuisance popup bubble telling you: You can search from here with Google According to a bug ticket you can create a master_preferences file “in the same directory as the chrome binary” and add this information to it: { “distribution” : { “suppress_first_run_bubble”: true } } That did not work for me, however, I used a command line switch ( a.k.a. a “flag” ) to successfully disable this popup balloon from showing. Just use: –no-first-run When you are launching the Chrome / Chromium player. That would look something like this on Linux: ./chrome –no-first-run Or like this on Windows: C:\path_to_chrome\chrome.exe –no-first-run

Posted in Linux | Tagged , | 1 Comment

strange error flushing buffer – solved

When trying to use some LAME libraries like the WAV2SWF from swftools I started gettin this error: strange error flushing buffer The file was still generated but it did not work. Here’s what I did to fix: Installed the latest version of swftools This was done on Ubuntu but you can probably do almost the same thing on Mac OS X. I tried using homebrew but was not able to get a new enough version of the software. Make sure you have zlib sudo apt-get install zlib1g-dev Or brew install zlib Next check the downloads page and get the latest version of the software, something like: cd /tmp wget “” cd swftools-2013-04-09-1007 ./configure make You can then install this if you want, but to test I just continued without installing: cd src ./wav2swf ~/input.wav this gave me another error: Error: no mp3 soundstream support compiled in. So to get around needing support for that you can just specify some additional parameter so it doesn’t have to detect them: ./wav2swf -d -s 44100 -o ~/test.swf ~/input.wav And voila! it worked! Additional parameters are: Usage: wav2swf [-o filename] file.wav -h , –help Print short help message and exit -V , –version Print version info and exit -o , –output <filename> Explicitly specify output file. (Otherwise, output will go to output.swf) -r , –framerate <fps> Set file framerate to <fps> frames per second. -s , –samplerate <sps> Set samplerate to <sps> frames per second (default: 11025). -d , –definesound Generate a DefineSound tag … Continue reading

Posted in Linux, Mac | Tagged , , | Leave a comment

Heroku pg migration error “PG:DataCorrupted: Error”

Heroku’s database system is having issues at the moment, if you use a command like this: heroku rake db:migrate You’ll see some details saying: Heroku pg migration error “PG:DataCorrupted: Error” This looks like a system-wide error on Heroku’s side. The complete error is something like: One option may be to try this: heroku run rake Although at this time the Heroku dashboard does not report any issues officially: Now one day later we see the results from the Heroku Support Bot: Your database HEROKU_POSTGRESQL_CRIMSON_URL on yourapp requires maintenance. During this period, your database credentials will become read-only. Once it has completed, your database URL will have changed, but we will update your app’s config variables accordingly. This automated maintenance is a necessary part of our Starter tier plans, Dev and Basic. Should you need more control over maintenance windows, a production database (Crane or higher) offers more control over database maintenance, as we are able to schedule them in advance and provide better tools for self-served maintenance. We expect maintenance to last just a few moments. We will update this ticket when maintenance begins, and again once it’s complete.

Posted in Linux, Server Admin | Leave a comment

Nagios Passive Check Example

The data below that makes up a service definition and commands definition below should serve as an example of what a passive check definition may look like: define service{ host_name service_description PassiveCheck check_freshness 1 ; active checks are NOT enabled active_checks_enabled 0 ; passive checks are enabled (this is how results are reported) passive_checks_enabled 1 ; 26 hour threshold, since backups may not always finish at the same time freshness_threshold 93600 ; this command is run only if the service results are “stale” check_command no-backup-report notification_interval 0 check_interval 60 retry_interval 1 max_check_attempts 1 # parallelize_check 1 # is_volatile 1 # obsess_over_service 0 } define command{ command_name no-backup-report command_line /usr/local/nagios/libexec/check_dummy 2 “CRITICAL: Results of backup job were not reported!” }

Posted in Linux | Tagged | Leave a comment

ssh command returns “stdin: is not a tty”

If you run a command via ssh (secure shell) on linux and you get the following output: stdin: is not a tty The most common cause is the mesg y or similar command found in the file: /etc/bashrc What is mesg ? mesg is a Unix command that sets or reports the permission other users have to write to your terminal using the talk and write commands. How can I fix this issue? Option 1 would be to comment out the line. Option 2 would be to change the line to something like this to only invoke the command when you are actually using a connection with tty: if tty -s; then mesg y; fi

Posted in Linux, Server Administration | Tagged , | Leave a comment