A reminder to myself http://simionbaws.ro Stuff I might need later. Thu, 01 Oct 2015 06:47:27 +0000 en-US hourly 1 http://wordpress.org/?v=4.3.1 Fix – Updated from OSX El Capitan Gold Master to Final Release, and beta update keeps showing in AppStore http://simionbaws.ro/osx/fix-updated-from-osx-el-capitan-gold-master-to-final-release-and-update-keeps-showing-in-appstore/ http://simionbaws.ro/osx/fix-updated-from-osx-el-capitan-gold-master-to-final-release-and-update-keeps-showing-in-appstore/#comments Thu, 01 Oct 2015 06:46:48 +0000 http://simionbaws.ro/?p=480 So, if you installed OSX Beta or GoldMaster versions, your account enrolled for pre-release updates.

Now, you installed OSX El Capitan from app store (final release, 10.11) but in AppStore -> Updates, Developer Beta keeps whowing you to update to version 10.11.1. This is because your account has now enrolled to pre-release updates.

Screen Shot 2015-10-01 at 9.39.05 AM

To fix this, go to System Preferences -> AppStore
You can see there is a setting called “Your computer is set to receive pre-release Software Update seeds”.
Click “Change” and then “Do not show pre-release Updates”.

osx-unenroll-2_2x-b1ee695c2546f38840d88372011fae81

Done. You can now refresh the Updates tab in AppStore.
Everything is clean.
Screen Shot 2015-10-01 at 9.45.38 AM

]]>
http://simionbaws.ro/osx/fix-updated-from-osx-el-capitan-gold-master-to-final-release-and-update-keeps-showing-in-appstore/feed/ 0
OSX Disk Utility Erasing/Formatting stuck at “Unmounting disk …”, “Couldn’t unmount disk” http://simionbaws.ro/osx/osx-disk-utility-erasingformatting-stuck-at-unmounting-disk-couldnt-unmount-disk/ http://simionbaws.ro/osx/osx-disk-utility-erasingformatting-stuck-at-unmounting-disk-couldnt-unmount-disk/#comments Mon, 15 Jun 2015 07:23:08 +0000 http://simionbaws.ro/?p=466 If you are trying to format/erase a disk and disk utility/diskUtil is stuck at “unmounting disk”, probably “fsck_hfs” is stuck in a loop, trying to repair it before mounting.

couldnt-unmount-disk-disk-utility-error

I’ve seen solutions where you must boot from an external operating system, bla blah. Too complicated and time consuming.

To fix this fast and easy, start formatting, wait for “unmounting disk” message to appear, then go to Terminal, find the process with the following command

ps ax | grep fsck_hfs

You’ll get something like

simion@Simions-MacBook-Pro:~$ ps ax | grep fsck_hfs
 3693   ??  U      1:32.61 /System/Library/Filesystems/hfs.fs/Contents/Resources/./fsck_hfs -y /dev/disk2s2
 3984 s000  S+     0:00.00 grep fsck_hfs

Then … kill the process with

sudo kill 3693

Then it should continue automatically with formatting the drive.

Note that you must do this before disk utility gives the error message “Could not unmount disk”.

]]>
http://simionbaws.ro/osx/osx-disk-utility-erasingformatting-stuck-at-unmounting-disk-couldnt-unmount-disk/feed/ 0
Aplicatia Bancomate pentru Android (În curand și pe IOS) http://simionbaws.ro/stories/aplicatia-bancomate-pentru-android/ http://simionbaws.ro/stories/aplicatia-bancomate-pentru-android/#comments Sun, 08 Mar 2015 01:45:41 +0000 http://simionbaws.ro/?p=441 final

Această aplicație vă ajută să gasiți ușor și rapid bănci și bancomate (atm-uri) în toată România.

Important: momentan lucrează doar cu anumite bănci, pentru a asigura corectitudinea datelor. Baza de date este în continuă dezvoltare, si vom adăuga bănci noi în perioada ce urmează.

Specificații:
– Afișeaza cele mai apropiate bancomate și bănci din locația dumneavoastră, sau in orice alt punct pe hartă
– Locațiile bancomatelor sunt actualizate zilnic, din surse oficiale, in mod automat (dacă apar bancomate noi, sau se desființeaza bancomate vechi, noi vom ști primii)
– Opțiune de navigare catre un bancomat ales
– Opțiune de căutare adresă / locație
– În cazul băncilor (sucursalelor) este afișat și un număr de telefon
– Filtru în funcție de banca aleasă
– Acoperire in toata Romania
– Pentru eficiența transferului de date/baterie, sunt afișate cele mai apropiate 30 bancomate/sucursale din locația curentă sau locația aleasă de dumneavostră, calculele fiind efectuate pe server.

Ce deosebește această aplicatie față de celelalte aplicații din acest domeniu?
Contine doar acele bancomate ale căror coordonate pe hartă sunt obtinute din surse oficiale (banci). Bancile care nu oferă coordonate exacte ale bancomatelor nu sunt implementate momentan (geocodarea adresei ar putea fi imprecisă, acest subiect va fi tratat în următoarea versiune). Deci cu noi mergeți la sigur!
În plus, baza de date este actualizata zilnic, in mod automat, pentru fiecare bancă în parte.

Băncile implementate în momentul de față (coordonate din surse oficiale):
– Banca Transilvania
– Raifeissen Bank
– BRD groupe societe generale
– ING Romania
– Bancpost
– Alpha Bank
– Euronet (Banca Carpatica)
– OPT Bank
– Unicredit Tiriac Bank
– Piraeus Bank
– Banca Romanească
În acest moment exista peste 6000 de bancomate în baza de date, pentru aceste bănci.
Bănci ce vor fi implementate (prin geocodarea adresei) în perioada ce urmează:
– BCR – Banca Comerciala Romana (80% finalizat)
– Garanti Bank
– BCR
– CEC Bank
– CreditEurope Bank
– Libra Bank
– Pro Credit Bank
– Leumi Bank
– Millenium Bank
– Marfin Bank

 

get-it-on-google-play-store-logo

Screenshot_2015-03-24-01-17-56 Screenshot_2015-03-24-01-18-12 Screenshot_2015-03-24-01-18-30 Screenshot_2015-03-24-01-18-35 Screenshot_2015-03-24-01-18-51 Screenshot_2015-03-24-01-18-56 Screenshot_2015-03-24-01-20-04 Screenshot_2015-03-24-01-21-39

 

Aplicatia Bancomate pentru Android

Google+
]]>
http://simionbaws.ro/stories/aplicatia-bancomate-pentru-android/feed/ 0
Improve font rendering for IntelliJ IDEA / Pycharm in Ubuntu http://simionbaws.ro/linux/improve-font-rendering-for-intellij-idea-pycharm-in-ubuntu/ http://simionbaws.ro/linux/improve-font-rendering-for-intellij-idea-pycharm-in-ubuntu/#comments Wed, 26 Nov 2014 15:25:02 +0000 http://simionbaws.ro/?p=409 Stock font rendering in Pycharm / Intelliji IDEA is horrible on Ubuntu. To improve it, change the following:

 

First of all, we need to install Infinality fonts:

sudo add-apt-repository ppa:no1wantdthisname/ppa
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install fontconfig-infinality

sudo /etc/fonts/infinality/infctl.sh setstyle linux
sudo gedit /etc/profile.d/infinality-settings.sh
# and set
USE_STYLE="UBUNTU"

Installed the patched OpenJDK with fontfix:

sudo apt-add-repository -y ppa:no1wantdthisname/openjdk-fontfix
sudo apt-get update
sudo apt-get install openjdk-7-jdk

In

$IDEA_HOME/bin/*.vmoptions
  add the following: (PS: $IDEA_HOME is the path to IntelliJIdea or Pycharm)

-Dawt.useSystemAAFontSettings=lcd
-Dswing.aatext=true
-Dsun.java2d.xrender=true

and in 

~/.profile
  add

export PYCHARM_JDK=/usr/lib/jvm/java-1.7.0-openjdk-amd64"

 

or whatever the installed java path is.

Reboot.

Start the IDE and enjoy perfect fonts.

Google+
]]>
http://simionbaws.ro/linux/improve-font-rendering-for-intellij-idea-pycharm-in-ubuntu/feed/ 7
Ubuntu – Fix large fonts for Google Chrome in Address Bar and Bookmarks bar http://simionbaws.ro/linux/ubuntu-fix-large-fonts-for-google-chrome-in-address-bar-and-bookmarks-bar/ http://simionbaws.ro/linux/ubuntu-fix-large-fonts-for-google-chrome-in-address-bar-and-bookmarks-bar/#comments Mon, 24 Nov 2014 08:32:56 +0000 http://simionbaws.ro/?p=404 Since version 35, chrome switched to Aura framework and does not follow GTK theme anymore. This leads to large font size in address bar, and bookmarks bar.

However, it grabs font size settings from org.gnome.desktop.interface “font-name” property. To fix this, run the following command:

gsettings set org.gnome.desktop.interface font-name 'Ubuntu 10'
# or
gsettings set org.gnome.desktop.interface font-name 'Ubuntu 11'
# depending on your preferences

You must restart chrome for this to work.

Google+
]]>
http://simionbaws.ro/linux/ubuntu-fix-large-fonts-for-google-chrome-in-address-bar-and-bookmarks-bar/feed/ 0
Django `CheckboxSelectMultiple` with `ModelMultipleChoiceField` generates too many queries (solution) http://simionbaws.ro/programming/django-checkboxselectmultiple-with-modelmultiplechoicefield-generates-too-many-queries/ http://simionbaws.ro/programming/django-checkboxselectmultiple-with-modelmultiplechoicefield-generates-too-many-queries/#comments Sat, 13 Sep 2014 11:57:18 +0000 http://simionbaws.ro/?p=388 If you use 
django.forms.ModelMultipleChoiceField
 with the default widget (
django.forms.widgets.SelectMultiple
 ), all’s good.

However, if you need to generate checkboxes for your choices, and use 

django.forms.widgets.CheckboxSelectMultiple
 you’ll notice that the field will generate alot of queries (one for each element in the queryset), which is really really bad. I personally ended up with hundred of queries.

Fix: add 

cache_choices=True
 to your 
django.forms.ModelMultipleChoiceField

Example:

Good practice:

test = forms.ModelMultipleChoiceField(
        queryset=MyModel.objects.all(),
        cache_choices=True,
        widget=forms.CheckboxSelectMultiple)

Bad practice:

test = forms.ModelMultipleChoiceField(
        queryset=MyModel.objects.all(),
        widget=forms.CheckboxSelectMultiple)

django-logo-negative

Google+
]]>
http://simionbaws.ro/programming/django-checkboxselectmultiple-with-modelmultiplechoicefield-generates-too-many-queries/feed/ 0
South migrations and MariaDB http://simionbaws.ro/stories/south-migrations-and-mariadb/ http://simionbaws.ro/stories/south-migrations-and-mariadb/#comments Fri, 22 Aug 2014 15:33:24 +0000 http://simionbaws.ro/?p=380 If you’re working on a Django project along with other members of your team and you’re using MariaDB (while the others are using MySQL) you’re gonna have a bad time. Everytime you’ll run migrations generated on a machine with other database than yours you’ll get a strange exception and Google wouldn’t give you too many hopes about solving it.

The exception, django.db.transaction.TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK is caused by leave_transaction_management method in django/db/backends/__init__.py and its source seems to be an incompatibility between MariaDB and MySQL (even if the former is just a fork of the other one).

So you want a fix? I couldn’t find any, but I fixed this by compiling MySQL from AUR (I’m using Manjaro, which is based on Arch Linux). Even if it’s not really a solution maybe you’re coming here from Google and maybe this will help you to solve your issue: Arch/Manjaro uses MariaDB and South seems to not like it very much.

Google+
]]>
http://simionbaws.ro/stories/south-migrations-and-mariadb/feed/ 3
Command/Shortcut to Lock Screen with “away message prompt” in Linux Mint 17 / Cinnamon http://simionbaws.ro/linux/commandshortcut-to-lock-screen-with-away-message-prompt-in-linux-mint-17-cinnamon/ http://simionbaws.ro/linux/commandshortcut-to-lock-screen-with-away-message-prompt-in-linux-mint-17-cinnamon/#comments Tue, 24 Jun 2014 09:50:09 +0000 http://simionbaws.ro/?p=371 If you want to have a shortcut with for locking the screen, but with prompt for lock message, here’s what you need to do:

  1. Go to Settings -> Keyboard, then click on Keyboard shortcuts tab

  2. Click on Add custom shortcut button, and enter the following command:

    python /usr/lib/cinnamon-screensaver-lock-dialog/cinnamon-screensaver-lock-dialog.py

    example:
    Screenshot from 2014-06-24 12:41:27

  3. Click Add and then assign it a shortcut.
    For example, the default lock screen shortcut is Ctrl+Alt+L. For the one with prompt, you can assign Ctrl+L.
  4. You’re done.
    When you want to lock your screen with a custom “away” message, just press the shortcut you assigned (Ctrl + L)

Screenshot from 2014-06-24 12:47:44

Google+
]]>
http://simionbaws.ro/linux/commandshortcut-to-lock-screen-with-away-message-prompt-in-linux-mint-17-cinnamon/feed/ 0
Install Skype 4.3 in Arch Linux / Manjaro http://simionbaws.ro/linux/install-skype-4-3-in-arch-linux-manjaro/ http://simionbaws.ro/linux/install-skype-4-3-in-arch-linux-manjaro/#comments Wed, 18 Jun 2014 21:46:56 +0000 http://simionbaws.ro/?p=356 Hi there,

Skype just released version 4.3 for linux. You can read this article  from OMG Ubuntu! to see what’s new in 4.3

Long story short:

  • native notifications
  • UI improvements (new toolbar, better login screen, design changes)
  • floating widget for Call
  • cloud based Group Chat
  • support for PulseAudio 3.0 and 4.0

Currently, the AUR “multilib/skype” package is not upgraded to 4.3. If you don’t wish to wait, here’s what you must do:

  1. Download Skype -> http://www.skype.com/go/linux (Choose “Dynamic” from distribution dropdown)
  2. Extract the archive
    cd Downloads
    
    tar -xjf skype-4.3.*
  3. Move the contents of the extracted folder to /opt/skype
    sudo mkdir /opt/skype
    
    sudo mv skype-4.3.*/* /opt/skype
  4. Edit
    /usr/bin/skype
     , and change the
    exec
      command path to
    exec "/opt/skype/skype" "$@"
     

    #!/bin/bash
    
    LIBDIR="/usr/lib32"
    
    if [[ -e "$LIBDIR/libv4l/v4l2convert.so" ]]; then
            export LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$LIBDIR/libv4l/v4l2convert.so"
    fi
    
    if [[ -e "/usr/share/skype/lib/libQtWebKit.so.4" ]]; then
            export LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}/usr/share/skype/lib/libQtWebKit.so.4"
    fi
    
    # exec "$LIBDIR/skype/skype" "$@"  # (old one)
    exec "/opt/skype/skype" "$@"

Google+
]]>
http://simionbaws.ro/linux/install-skype-4-3-in-arch-linux-manjaro/feed/ 4
Sublime slack – preformatted text http://simionbaws.ro/sublime-slack/sublime-slack-preformatted-text/ http://simionbaws.ro/sublime-slack/sublime-slack-preformatted-text/#comments Mon, 09 Jun 2014 19:24:37 +0000 http://simionbaws.ro/?p=350 Changelog in 1.4.5: Whenever you send a code selection (ctrl+alt+u), it is preformatted.

Example:

Screenshot from 2014-06-09 22:12:21

Google+
]]>
http://simionbaws.ro/sublime-slack/sublime-slack-preformatted-text/feed/ 0