According to the crypt(3) manual, Blowfish (indicated by the $2a$ prefix) is one of the supported cypher methods:
ID | Method
─────────────────────────────────────────────────────────
1 | MD5
2a | Blowfish (not in mainline glibc; added in some
| Linux distributions)
5 | SHA-256 (since glibc 2.7)
6 | SHA-512 (since glibc 2.7)
However the part saying Blowfish (not in mainline glibc; added in some Linux distributions) is confusing and underdocumented, so I have a few questions.
First of all, if "mainline" glibc does not support Blowfish, then which glibc does?
Ubuntu 14.04 uses glibc 2.19, packaged in libc6 / libc6-dev packages. Assuming this is the "mainline" glibc, then Blowfish is not supported. Apparently there is a patch called crypt_blowfish adding Blowfish support to glibc. Why is it not enabled by default in Ubuntu? And last but not least, what is the easiest way to make the C crypt() function in Ubuntu understand Blowfish hashes?
First of all, if "mainline" glibc does not support Blowfish, then which glibc does?
Built by distributions listed at openwall page, e.g. ALT Linux and SUSE.
If it's interesting for you, why it is not in mainline, you can read Ulrich Drepper's article.
Why is it not enabled by default in Ubuntu?
This matter was discussed here: LP#1349252.
And last but not least, what is the easiest way to make the C crypt() function in Ubuntu understand Blowfish hashes?
Probably, there is no way to make it without building your own glibc package.
Related
I call cvxopt.glpk.ilp in Python 3.6.6, cvxopt==1.2.3 for a boolean optimization problem with about 500k boolean variables. It is solved in 1.5 hours, but it seems to run on just one core! How can I make it run on all or a specific set of cores?
The server with Linux Ubuntu x86_64 has 16 or 32 physical cores. My process affinity is 64 cores (I assume due to hyperthreading).
> grep ^cpu\\scores /proc/cpuinfo | uniq
16
> grep -c ^processor /proc/cpuinfo
64
> taskset -cp <PID>
pid <PID> current affinity list: 0-63
However top shows only 100% CPU for my process, and htop shows that only one core is 100% busy (some others are slightly loaded presumably by other users).
I set OMP_NUM_THREADS=32 and started my program again, but still one core. It's a bit difficult to restart the server itself. I don't have root access to the server.
I installed cvxopt from a company's internal repo which should be a mirror of PyPI. The following libs are installed in /usr/lib: liblapack, liblapack_atlas, libopenblas, libblas, libcblas, libatlas.
Here some SO-user writes, that GLPK is not multithreaded. This is the solver used by default as cvxopt has no own MIP-solver.
As cvxopt only supports GLPK as open-source mixed-integer programming solver, you are out of luck.
Alternatively you can use CoinOR's Cbc, which is usually a much better solver than GLPK while still being open-source. This one also can be compiled with parallelization. See some benchmarks which also indicate that GLPK is really without parallel support.
But as there is no support in cvxopt, you will need some alternative access-point:
own C/C++ based wrapper
pulp
binary install available
python-mip
binary install available
Google's ortools
binary install available
cylp
cvxpy + cylp
binary install available for cvxpy; without cylp-build
Those:
have very different modelling-styles (from completely low-level: cylp to very high-level: cvxpy)
i'm not sure if all those builds are compiled with enable-parallel (which is needed when compiling Cbx)
Furthermore: don't expect too much gain from multithreading. It's usually way worse than linear speedup (as for all combinatorial-optimization problems which are not based on brute-force).
(Imho the GIL does not matter as all those are C-extensions where the GIL is not in the way)
Moved from here, because it's about compiling software.
My original problem: I want to play Super Mario Galaxy 2 with another player. But whatever keys I assign to move the cursor, it instead moves it all the way to the corner (or edge) of the screen. Linux theoretically has the ability to have multiple cursors (at least the display system "X" allows it), but from a research it looks like I would have to make major changes to the system to actually use it. And even then I doubt that Dolphin would support it.
My current problem: Relative motion of a cursor from keys is present in the current betas of Dolphin, but I can't get it installed. There are no regular installers for it, instead there are source downloads and this tutorial.
I installed the dependencies, downloaded the beta, created and entered the "Build" directory, but when I try cmake .., I get this output:
-- Detected architecture: x86_64
-- X11 support enabled
-- Xrandr found
-- Found avcodec: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libavcodec.so
-- Found avformat: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libavformat.so
-- Found avutil: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libavutil.so
-- Found swresample: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libswresample.so
-- Found swscale: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libswscale.so
-- libav/ffmpeg found, enabling AVI frame dumps
-- libevdev/libudev found, enabling evdev controller backend
-- Using named pipes as controller inputs
-- Watching game memory for changes
-- Enabling analytics collection (subject to end-user opt-in)
-- Using static enet from Externals
-- Using static xxhash from Externals
-- Using shared zlib
-- Using static lzo from Externals
-- Using shared libpng
-- Using shared LibUSB
-- Found SFML 2.4 in /usr/include
-- Using shared SFML
-- Using shared miniupnpc
-- Could NOT find MBEDTLS (missing: MBEDTLS_VERSION_OK)
-- Using static mbed TLS from Externals
-- Using shared libcurl
-- Using static DiscordRPC from Externals
-- libsystemd found, enabling traversal server watchdog support
-- Using static gtest from Externals
-- Could NOT find OpenSLES (missing: OPENSLES_LIBRARY OPENSLES_INCLUDE_DIR)
-- ALSA found, enabling ALSA sound backend
-- PulseAudio found, enabling PulseAudio sound backend
-- BlueZ found, enabling bluetooth support
CMake Error at Source/Core/DolphinQt/CMakeLists.txt:1 (find_package):
Could not find a configuration file for package "Qt5" that is compatible
with requested version "5.9".
The following configuration files were considered but not accepted:
/usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake, version: 5.7.1
-- Configuring incomplete, errors occurred!
See also "/home/fabian/dolphin_beta/dolphin-emu/Build/CMakeFiles/CMakeOutput.log".
See also "/home/fabian/dolphin_beta/dolphin-emu/Build/CMakeFiles/CMakeError.log".
The output of apt-file search Qt5Config.cmake is:
libaccounts-qt5-dev: /usr/lib/x86_64-linux-gnu/cmake/AccountsQt5/AccountsQt5Config.cmake
libphonon4qt5-dev: /usr/lib/x86_64-linux-gnu/cmake/phonon4qt5/Phonon4Qt5Config.cmake
libsignon-qt5-dev: /usr/lib/x86_64-linux-gnu/cmake/SignOnQt5/SignOnQt5Config.cmake
libtelepathy-qt5-dev: /usr/lib/x86_64-linux-gnu/cmake/TelepathyQt5/TelepathyQt5Config.cmake
qtbase5-dev: /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake
To be safe I installed all five of these packages. I also installed version 5.10 of Qt5-default from here, later also 5.11. I also installed qtbase5-private-dev, libreadline-dev and tried to install libpolarssl-dev, but the page gave error messages for all four servers (the Taiwanian one just loads forever, the others give 404). Then I tried the Qt installer and selected the latest stable version (5.11 I think) once and 5.9 once.
None of these steps helped, I still get the same output as at the beginning.
Here is a copy of CMakeOutput.log from when I last tried installing: https://pastebin.com/EP5qDGE9
Here is a copy of CMakeError.log from when I last tried installing: https://pastebin.com/9p4Ni0jE
My specs:
Debian 9.5
Cinnamon 3.2.7
Linux Kernel 4.9.0-8-amd64
Installed packages: https://pastebin.com/DeYAvJtu
Many thanks to the user dugan on linuxquestions.org! He solved my problem here.
I just had to install Qt from a different source (I used the Qt installer, as mentioned in the question), to have a different version of it in another location. The reason for that is that many programs on Debian rely on an earlier version of Qt, so just updating it would break a lot, that's also why Synaptic&Co. don't update it.
Then I had to add the binary to the PATH variable, like so:
export PATH=/home/fabian/Qt/5.11.2/gcc_64/bin:$PATH
Then I was able to just install Dolphin beta regularly, like the tutorial says it.
I would like to encrypt my org files(org-mode) or a region of the file in emacs. The option given in the tool does not work (gives me the error apply: Searching for program: no such file or directory, gpg). I guess because I am using emacs on windows and all the search on this topic point towards encrypting the files on UNIX platform. Can you please help me on how encryption can be achieved on windows. Thanks in advance.
I am using ergoemacs for windows downloaded from http://ergoemacs.org/index.html. The version is as follows:
GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601) of 2012-08-29 on MARVIN ErgoEmacs distribution 2.0.0
Install GnuPG onto your Windows machine. Binary versions (i.e. ones that you don't have to compile yourself) are available from http://gpg4win.org/.
Once GnuPG is installed, and assuming you add its binary directory to your Windows %PATH%, Emacs should be able to use it.
solved the problem by installing cygwin (which has GPG installed) and using the same in emacs.
This can be done by giving the cgywin installed directory in the option cygwin-root-directory of the emacs editor
In the code file i have to link just one library (from gi.repository import Gtk).
But when i run it it replies me:
Gtk-WARNING **: Unknown property: GtkTextView.input-purpose
ERROR --file: collega_GUI --riga: 160, 'Grid' object has no attribute
'get_child_at'
So i tried to find missing libraries:
$ dpkg -l libgtk[0-9]* | grep ^i
ii libgtk2.0-0 2.24.10-0ubuntu6 GTK+ graphical user interface library
ii libgtk2.0-bin 2.24.10-0ubuntu6 programs for the GTK+ graphical user interface library
ii libgtk2.0-common 2.24.10-0ubuntu6 common files for the GTK+ graphical user interface library
ii libgtk2.0-dev 2.24.10-0ubuntu6 development files for the GTK+ library
and Grid object needs gtk3+, so let's install it:
$ sudo apt-get install libgtk-3-0 libgtk-3-common libgtk-3-dev libgtk-3-doc
0 updated, 0 installed, 0 removed and 0 not upgraded
So it's all fine with libraries and:
gtk-grid-get-child-at exists
GtkTextView--input-purpose exists
that "input-purpose" problem is strange, because on the previous OS (ubuntu 13.10, now i'm on 12.04) i didn't get that problem.
The UI is built by Glade, but i never get that error previously: on the same project files, but on a different OS version.
I still think i need to install some libraries.
EDIT :: ged_child_at function call
griglia = self.__builder.get_object('grid3')
for i in range(0, 3):
area = griglia.get_child_at(i, 0)
self.__builder.get_object(Gtk.Buildable.get_name(area)).connect("draw", self.draw)
The tag Since 3.6 for that property which means in Gtk+ 3.4 (which is the default of ubuntu 12.04 if I recall correctly).
So you either work around it or you go the thorny way of upgrading to Gtk+ 3.6 - which I - with all respect - do strongly disrecommend - especially since Unity needs various patches being incorporated into Gtk+ to work at all.
I just checked in gtk+-3.10.x the python bindings are fine and include get_child_at(..).
This question contains an answer that in fact this is a bug in the python bindings of gtk+ 3.4.
Solutions: Backport the git commit that fixes this (should be very tiny git commit) recompile/create deb package (significant knowledge required).
An alternate route would be to locally fix the binding specification and recreate the python introspection bindings locally - not sure if that is possible though - never did that.
I used an encrypted file to store my passwords for years. It has been encrypted using the vi -x command on Sun Solaris 10. I now tried to open the file on a linux box with bothvi -x and vi -x -cm=blowfish. Sadly the file is completely messed up. My guess is that a different encryption algorithm has been used on Solaris. How can I find out which algorithm has been used and how can I open the file with a more recent version of vi?
I do know the correct password and I do know several words in the encrypted file.
P.S.: I do not have any access to a solaris 10 Machine anymore
I think vi uses the crypt function. This is a long shot, but if you have access to mcrypt, this should decode solaris crypt:
mcrypt -a des --keymode pkdes --bare --noiv --decrypt filename
old unix style crypt
mcrypt -a enigma --keymode scrypt --bare --decrypt filename
/usr/bin/vi (also linked from /usr/ucb/vi), /usr/xpg4/bin/vi, and /usr/xpg6/bin/vi on Solaris 10 (and such of those as were on all earlier versions of Solaris) all used crypt(1) (Enigma variant) encryption.
On Solaris 11 and later, vi is actually vim, and uses whatever encryption that version of vim supports, which is NOT compatible with crypt(1).
"Old" vi may still be on Solaris 11 as /usr/sunos/bin/vi, but does not have the -x option any more.
crypt(1) is also no longer on Solaris 11.
But one can easily scrounge the source (google for usr/src/cmd/crypt/crypt.c) and fix up whatever version one finds to compile ok.
And as a previous poster indicated, mcrypt can do the job too.
The latter is available for Macs via (at least) MacPorts ("port install mcrypt" although a trivial test of running mcrypt there didn't work for me), for CentOS via "yum install mcrypt", for Ubuntu via "apt install mcrypt"; cygwin also has an mcrypt package.
For any other OS or distro, you're on your own; I don't have everything. 😀