Sunday, June 4, 2017

fixing B-frames ('packed B-frames') vids

mplayer warning

[mpeg4 @ 0xb7411fe0]Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using a tool like VirtualDub or avidemux to fix it.

You'd get this warning, and video wouldn't be playable (it'd be super slow in the video stream, while the audio is OK).

Suggested fix

ffmpeg -i input_vid.avi -codec copy -bsf:v mpeg4_unpack_bframes   output_vid.avi

(didn't work, still was super slow)

Work-around

You'll need: avidemux, ffmpeg

Steps
1. convert file to avi (mine were in ogm format)

ffmpeg -i $INPUT_FILE -codec copy $OUTPUT_FILE

2. separate audio

ffmpeg -i $INPUT_FILE  -vn $OUTPUT_FILE

3. open the avi file on avidemux -> choose audio -> disable sound tracks

4. merge audio and video in one final vid

ffmpeg -i $VID_FILE -i $AUDIO_FILE -codec copy -shortest $OUTPUT_FILE

You can then just remove all remaining files created during the process and just the one on step 4. It'll still show the warning, but the video will be watchable (it was for me at least).

Sunday, November 15, 2015

SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581) fix on debian 8

I'm using:

Debian GNU/Linux 8
Python 2.7.9
openssl 1.0.1k-3


Using python (pip) to access https stuff, I got the error
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/search.py", line 40, in run
pypi_hits = self.search(query, index_url)
File "/usr/lib/python2.7/dist-packages/pip/commands/search.py", line 54, in search
hits = pypi.search({'name': query, 'summary': query}, 'or')
File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1591, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1301, in single_request
self.send_content(h, request_body)
File "/usr/lib/python2.7/xmlrpclib.py", line 1448, in send_content
connection.endheaders(request_body)
File "/usr/lib/python2.7/httplib.py", line 997, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 850, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 812, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 1212, in connect
server_hostname=server_hostname)
File "/usr/lib/python2.7/ssl.py", line 350, in wrap_socket
_context=self)
File "/usr/lib/python2.7/ssl.py", line 566, in __init__
self.do_handshake()
File "/usr/lib/python2.7/ssl.py", line 788, in do_handshake
self._sslobj.do_handshake()
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)


Quick fix (can or cannot work... and not to be permanent as not
verifying the certificates is not very smart)
In your code, do:

import ssl
ssl._create_default_https_context = ssl._create_unverified_context


Permanent solution


rmdir /usr/local/share/ca-certificates (was blank)
ln -s /usr/share/ca-certificates/mozilla /usr/local/share/ca-certificates
sudo apt-get install ca-certificates # in case you don't have it already
sudo update-ca-certificates

# the new files will be sym-linked here:
/etc/ssl/certs

That fixed it for me at least.

Sunday, December 8, 2013

emacs image-dired mode fixing "Thumb could not be created" thing

Ah, emacs's dired-mode... if you don't know it, do "C-h r m Dired" on your emacs right now (do Image-Dired instead for image dired mode too).

You need to have a few extra packages for image manipulation installed, but it's like the only descent/realistic way to manage (a large number of) image files I know...

"Thumb could not be created  for file ..."

This error can be annoying. In my system with:
GraphicsMagick 1.3.12 
emacs-24.3

If you have all the necessary packages and all, then probably it's because of the "strip" option used by default by image-dired-mode to make thumbnails/resize original files.


Adding this to your .emacs file should fix it.
(setq image-dired-cmd-create-thumbnail-options "%p -size %wx%h \"%f\" -resize \"%wx%h>\" jpeg:\"%t\"") ;; remove -strip option
(setq image-dired-cmd-create-temp-image-options "%p -size %wx%h \"%f\" -resize \"%wx%h>\" jpeg:\"%t\"");; remove -strip option
;;(setq image-dired-external-viewer "/usr/bin/xzgv");; a viewer I like, just in case you're interested

As an extra advice for image-dired noobs, having a 3 window emacs frame is probably the expected thing for having it working. One for dired-mode, the other for the thumbnails of image-dired, and the other for the larger preview/original size pic.
It let's you add comments/tags in an emacs exclusive "database" file, so you can manage/search for images pretty easily and fast.

Sunday, November 17, 2013

my "bodybulding" training

In results:
Before / After
  

These are my results for my 3.5 months of training.
Bulk up: 3 months ( +4 kg, +2% fat, +900g of muscle)
Reduce fat: 2~3 weeks (- 2.5kg, -1% of fat, -50g of muscle).

If you're like me and want to look more like Arnold Schwarzenegger, rather than a simple thin guy, please keep reading. If not, please leave the page.


After drinking alcohol pretty much 3~4 times a week and having a super unhealthy diet and lifestyle after being dumped by fiance, I looked a lot worst that in the "before" pic.
I hit the bottom of the bottom of my life so far at least in self-destructive/depressively speaking.
Leaving aside "why" I began training, it was something I had been wanting to do a long time, but didn't have the money/time/will till now.
Apparently I have good genes for muscle development, which helps. After 2~3 years, I expect to look more like a real bodybuilder.

There are many stories out there around how a certain diet/fitness training can help you do this kind of change in your body. But most of it is sh*t. And believe me, the worst thing you can do is do a ketosis diet, like eating once a day, or having days without eating anything. You only do that kind of thing if you have some kind of trauma for being a f*cking fatso for long, and having no idea of how to change that and being totally desperate.

You'll basically need:
  1. a gym subcription / + optional sport or fitness recreational activity (me: capoeira/brazilian jujitsu and mountain biking) 
  2. a microwave, fridge, and basic cooking skills (you'll begin bodybuilding cooking)
  3. time to rest and sleep
  4. track recording tool (notebook, etc. I use a database in my computer)
  5. calories calculating tool (notebook, etc. I use a lisp program I made)
  6. the will to improve yourself or kill someone so much you'll stick with the plan

About one third of all is in the gym, and how you develop your musculature using the progressive overload principle. Go to youtube or something, and watch the Joe Weider's training tapes. If you want to look a bodybuilder, you gotta train like one.
The other two thirds are about the time you take to rest your body /sleep, and how you calculate your diet.
You can do the diet change gradually, having to better have about 40%, 50%, and 10% of protein, carbohydrates, and fat daily. With the amount of calories being higher than the amount you need --- get in an over calories diet --- (in the bulk up phase, where you generate the amount of muscle you want, fat will be generated too, don't worry about it you can get thin anytime, it's super easy when you begin understanding your body and how it uses the food you take).

The basic cooking skills part is nice too. Especially since you're like me and never cooked before, and think the best food you have had is whatever your ex-gf or her mom had made for you. Everything will taste better when knowing that's what your body requires, and how it be used by it. Read in sites like bodybuilding.com about simple/complex carbs, protein, fat, and experiment on yourself about what suits your body better. You'll probably be making your food in bulk ilke twice a week, and heating stuffs with a microwave everyday. (From my second month of training, I started eating 5~7 times a day, bringing packed food to the office). Oatmeal, non-stick-spray (cooking oil spray) and baked chicken breast, brown rice, (especially sweet) potatoes, eggs/milk, and of course protein shakes and supplements will be your strongest allies.

Weight yourself everyday to keep record, as well as write down everything you eat, and it's nutrition values so you can make sure you're having enough calories and carbs/protein, or if you get too fat, how much is too much for you.
Also take pics of yourself once every 2 weeks, which will help keep record of how your body changes (you really don't notice when looking yourself at the mirror everyday, although probably your friends do).
An occasional junk food/eating out meal is OK. But if possible, stay away from alcohol, that's not only for bodybuilders, if you want to stay healthy in general...

Some people say I look ripped/muscular enough now, but I want to get bigger, so I'll keep bulking up again for a while. Really, this changes your life in so many ways I wish I had started it long time ago. Now I can cook pretty good (which also makes your life cheaper if you were used to eat it out), look a lot better, and feel a lot more confident of martial arts skills as well... which can't hurt (me).

Friday, August 9, 2013

omg lavabit.com is down...

I had been using this account for so long, and it's down all of the sudden><...

I guess the only options I have are either renting a server (having to pay monthly!), or use gmail... none of which can really be told to be very free (as in freedom).
Argh, if any of you have any good mail provider suggestions...

Sunday, August 4, 2013

The cheapest usable cellphone in Japan

Update

Now you can get a super cheap SIM-free cellphone in Japan by many companies (let me recommend "rakuten mobile"...), with a phone number and everything, so this is kind of outdated.



Japanese cellphone companies can be crazy.
They have some very hard to get bills, lots of plans which don't make much sense, and since the moment you sign the contract they usually will make you get in for some plans you don't plan to use but "need" to sign first in order for the campaign to apply, of which without it'd be even more expensive...

I used the Japanese company au's cellphone for a while, for about 7,500JPY per month. Then softbank, for about 9,000JPY per month...
That's pretty much my cellphone to receive emails, browse the web a bit while on the train, and get occasional phone calls. So it's pretty much a big waste of money...

Then, thanks to IP phones... we can get something a lot better, a lot cheaper! The services are:
Rakuten fusion smart phone (SIP phone number)
Rakuten LTE

LTE just refers to the (micro-)SIM chip you get to connect your cellphone to a Japanese cellphone network (docomo's) and use internet. And the SIP phone number is the thing that lets you do/receive phone calls via internet, you can also use it from your computer as you can guess (use Ekiga on GNU/Linux).

The SIP phone number DOESN'T have a basic fee per month. And you can make phone calls for free to most IP phone numbers (050- numbers). That means as long as you only receive phone calls, you'll be talking for free. And it's cheaper to make phone calls than from regular cellphone's phone numbers.
The bad thing, is that as you can guess, it relies on your network... If you are in a remote area, and your internet connection is kinda slow or doesn't respond very fast, you'll have a bit of a lag during the call. Kind of when you make a long distance phone call.

LTE works just fine, it has a basic fee from 875JPY to like 2,980JPY per month, depending on the bandwidth plan you choose. These are some very easy to understand plans...

The "bad" thing, is that you have to buy the cellphone in advance by yourself, and do the setup (put the SIM chip into the phone) by yourself. But that's pretty reasonable for the price you get, being that I pay like 900~1,500JPY monthly for this phone... about 6 to 9 times cheaper than I used to.

my little sister dog

Ah I'm sure how she's is... she wasn't really my dog...
But I will never forget how friendly she was with me, even when apparently she wasn't like that with everyone, which made me feel like a family member...
I truly hope she's doing good, and making her family feel loved as they deserve.
I hope I can see, or at least hear from her again someday soon. Although that's not likely to happen for reasons out of my control...

I don't know, people tend to tell me not to be negative, and to just ignore depressing/bad stuffs.
Although sometimes I do follow the advice, that just sounds like fooling oneself. I understand being positive is probably a lot more attractive and all socially, but what's the point in ignoring your own feelings and thoughts. If we truly are because we think, I think that should be expressed in a healthy way rather than just keeping it to ourselves...

Anyway, that was my internet message to my almost little sister dog. Please visit me in my dreams at least.

Sociable