What are the most useful gems to use in Rails?
RubyGems were developed to simplify and accelerate the stages of the application creation deployment and library connection. Utilizing this package manager for Ruby saves you time as you get ready-made solutions to almost any task instead of writing the functions from scratch. Each gem contains a particular element of functionality including all related files. Unfortunately they aren structured in any way so in order to find ruby gems it better to use a regular search engine and the required key words (check GitHub s ). Our dedicated development team also actively employs Ruby Gems in the process of software development. Here is the top of the most popular and useful ruby gems according to our experience GeoCoder s . Being able to connect through itself over 4 APIs this Ruby gem implements both the direct and reverse geocoding by IP address geographical coordinates and even real physical addresses (e.g. the address of the street). Bullet s . The most downloaded Ruby gems out there. It was initially created with an intention to boost software performance. It does so by decreasing the total amount of client-server requests. Basically Bullet tracks the N+1 cases of requests and notifies the developer when other tools can be used instead (e.g. cache counter). Pry s . We rmend to simplify the bug fixing procedures for your RoR-based application with the Pry gem which is a more advanced alternative to the standard IRB wrapper. ActiveModelSerializers s (which starts lagging while processingpound documents) and uses caching. Fast JSON API s . Fast JSON API wille in handy when you need fast serialization of software code. It works much faster than Wicked PDF s . This gem is working alongside with wkhtmltopdf s and helps realizing an interaction with the DSL generator. Devise Masquerade s . This Ruby gem helps developing multi user apps. In particular youll be able to test your app from the perspective of users with different levels of access. Devise s . Based on the MVC model the Devise gem can provide secure user authentication and session management. Letter opener s . If you need to create a newsletter mechanism to send notifications to all users that launched your app this gem will help you do that much easier you won need to integrate and configure your own SMTP server. Money Rails s . If you are planning to integrate your app with Ruby Money this gem wille in quite handy. Pundit s . A tool that allows defining different levels of access to the app functionality according to the rights of an authorized user.
How superior is Linux compared to Windows and Mac?
I can tell you why I came back to Linux from Windows six months ago.n It runs so much faster. So much italic . Applications written for Linux distros are generally much cleaner faster and less slimy than Windows counterparts. For example when I used Windows I really struggled to find a free utility that would let me convert audio files from one format to another that wasn't italic bundled with adware. (Even if you opt out that slimy feeling lasts forever.) Even the free antivirus I used for years with Windows kept nagging me to download other (paid) software by the samepany. So slimy. And apparently this was one of the least italic slimy free antivirus programs too. I can accented letters without having to install a third-party program. I can hit the Print Screen button and have my screenshot saved to a file instead of just copying to my clipboard without having to install a third-party program. Having italic switched back here are some more things that helped me realise I was truly back homen On the rare occasion I boot back into Windows it is so slow . I cannot believe I put up with that before. For years. I even reinstalled Windows to get rid of the cruft and it was still slow. I greatly prefer package management in Linux than in Windows. The exact system varies from distro to distro but in Ubuntu-derived elementary OS I can pull on some central repositories of non-slimy software dependencies are automatically resolved updates are pushed through a centralised update manager and italic I can add third-party repositories for stuff I really really want that isn't in the central repos. Inparison Windows is basically the Wild West. I feel more in control of my system. It's more transparent and I can tinker with it to make my theme look cooler or whatever I want really. Pantheon just looks nicer than any edition of Windows. Other DEs like GNOME look nicer too in my opinion. I don't have that much experience with Macs. I've had to use them at uni and mostly they drive me crazy because I can't figure out the keyboard shortcuts and I always forget it uses global menus at the top of the screen... but that's the kind of thing I would probably get used to if I used them more often than one class a week. Mostly I find Macs unappealing because (it seems to me) you have to pay a premium for the privilege of being locked into an ecosystem. If you want to run OS X it almost has to be on Apple hardware. If you want an iPhone or iPad you're going to need some special overpriced Apple charging cables because those devices aren'tpatible with the standard MicroUSB ones. Apple even deliberately makes it difficult for people to manage their own iPods from Linux. If you like spending money and don't mind being locked in Apple's ecosystem might suit you well but I'd just rather not.
How can I convert a PDF to XML?
Disclaimer Im the founder of s a software solution specialised in transforming semi-structured documents (invoices purchase orders reports ) into structured data such as XML CSV JSON. As already mentioned by other there is unfortunately no easy way to convert PDF to XML files. This is simply because the PDF format doesn include any structuring tags like for example HTML does. A PDF file includes in most cases just a flat description of the visual representation of its content. Which means that there are no indicators which would allow you to easily identify hierarchical data and key data points. Some PDF files actually do have XML data stored in their metadata though. For example electronic PDF invoices might have all relevant key data inside the document metadata. But at the time of writing PDFs containing XML data are rather the exception. But there are still ways to convert PDF to XML s ! You have basically two different problems here to solve First you need to get hold of all and s. The way we do it at Docparser is to check if we can extract data and pipe the files through a OCR library if no was returned. In either case I would rmend to rely on Linuxmand line utilities. While you might also find a Python library the Linuxmands usually work much better in my experience. In case we need to handle scanned s as well as hidden returned by the OCR. Once you are sure that the PDF file contains data you can use the Linuxmand line tool PdfToText s with the option - layout. You should then have a representation of your PDF file which has (nearly) the same layout. Convert Extracted Text Into Structured Data This one is difficult to answer without knowing your specific use-case. Converting unstructured or semi-structured into a XML structure can be easy challenging or impossible. It really depends on the kind of data your are dealing with and how granular the output needs to be. At Docparser we developed a set of tools that can help you transform PDF documents such as invoices purchase orders delivery orders etc. into fine grained structured data objects without any coding. If this is something you would be interested in Ill be more than happy to ge you through our free trial.
Is there any way to Convert PDF to Json?
Disclaimer Im the founder of s a software solution specialised in transforming semi-structured documents (invoices purchase orders reports ) into structured data such as JSON CSV XML. You have basically two different problems here to solve First you need to extract data from your PDF files Second you probably want to convert the extracted into individual data fields (Title Headline Text Date Reference Number ) which you can use to build your JSON data object Pull Text From PDF Files First we need to check if your PDF files are actually containing data or if they consist of scanned s we use an OCR system to convert them into searchable PDF files. Such PDF files contain the scanned images as well as hidden returned by the OCR. Once you are sure that the PDF file contains data you can use the Linuxmand line tool PdfToText s with the option - layout. You should then have a representation of your PDF file which has (nearly) the same layout. Convert Extracted Text Into Structured Data This one is difficult to answer without knowing your specific use-case. Converting unstructured or semi-structured into a JSON object can be easy challenging or impossible. It really depends on the kind of data your are dealing with and how granular the output needs to be. At Docparser s we developed a set of tools that can help you transform PDF documents such as invoices purchase orders delivery orders etc. into fine grained JSON data objects without any coding. If this is something you would be interested in Ill be more than happy to ge you through our free trial.
What are some time-saving tips that every Linux user should know?
First I suggest using bash italic rather than any alternative such as tcsh fish italic or zsh italic . These are fine alternatives but bash italic is the default on the vast majority of Linux and other modern Unix systems and derivatives (including MacOS X and *BSD systems). Don't just learn it. Don't just use it. MASTER bash italic ! Also master vi italic (by which I mostly mean the vi italic patible subset of vim italic ). You're an emacs italic fan. Fine. You can live in emacs italic . But if you're going to spend a significant amount of time at any sort of Linuxmand prompt then it's likely that you're involved in administering or operating lots of Linux machines or virtual machine instances in a cluster. (It's primarily in the administrative and operational details where you care whether it's Linux vs. any other Unix-like OS). If you're bouncing around among a multitude of systems then having to stop and ensure that tools like emacs italic or zsh italic are installed will cost you lots of time. You can invest your time in customizing the systems (and whatever infrastructure is in place to automate such customization) ... and you probaly should. But you can also invest some of your time in adapting our skills so you're veryfortable using the default shell and the faster default editor. If you find some system starting nano italic or some other editor when you runmands that try to automatically invoke editors for you then add export EDITOR=$(which vim) italic (or which vi) italic ... to your environment Combine these previous two suggestions. Use set -o vi italic with bash italic to set yourmand line and history editing key bindings to a subset of vi italic bindings. I also like to add bind C-lclear-screen C-plete italic ... to regain a couple of settings from the default ( emacs italic mode) bash italic settings. Also use the italic fc italic (the fixmand)mand (it's in bash italic Korn shell and probably zsh) italic . fc italic launches your preferred editor to allow full screen editing of somemand or range ofmands from your history. This is particularly handy when using cut & paste from web browsers other terminal windows and editors withplexmands. (Frequently you have to copy several different excerpts from such sources ... and doing so with separate operations for each is tedious and time consuming). With fc italic you simply do a sloppy copy of the whole passage containing the various bits of you need and all the cruft you want to remove. The issue amand like fc for Enter code ... paste is the whole mess and then use your favorite editingmands and macros to formulate the rest of yourmand. (In this example it would be your most recent for italic mand and you'd presumably be pasting in a list of targets to iterator over and a body ofmands to execute on each for example). When you save and exit ... themand is automatically executed by your shell. Obviously when the changes are simple then you can save keystrokes by using the various old csh italic patible ! italic history operators including ^ italic (for example changing something like foo to bar in the most recentmand using ^foo^barEnter italic ). But if you spend a lot of time doing ad hocplex multi-linemands .... fc italic can't be beat. Amon shell pattern I use goes something like this d='x xxx xxx ... code y yyy yyyy ... code z zzzz zzzz ... code ...' code echo $d | while read h f r; do echo do_something $h --someswitch $f --otherswitches $r; done code In other words use a shell variable to hold some lines of each line containing some arguments (all usually prepared in my editor in another window usually with creative database or other searches and so). Then iterate over those filling in amand template with my hostnames ssh italic mands and switches and so on. I run that once and look over the output to see if the generatedmands look right. After that I can use ^do echo^do italic ... to reissue the samemand but actually to do_something italic rather than merely inspecting what the resulting template rendering looks like. One trick there is that you can store a significant amount of arbitrary in a shell variable (easily over a 1K) and use that instead of temporary files for most purposes. You can iterate over lines and parse them into variable lists using the | while read x y z; do ...; done italic pattern. When parsing (separating the lines into fields into which to associate the variables (x y and z here) then your shell's IFS italic setting will be used (so you handle trivialma-separated or colon delimited files for example). Additionally the read italic mand will respect any quoting in the input line (consistent with the shell's normal quoting and escaping rules). Also all remaining contents on the line will be assigned to the last variable on the list. Overall I refer to this latter pattern | while read ...; do ....; done italic as the pipemill italic pattern. You're writing code to mill over the output from a pipe. It's very simple example of the producer-consumer pattern and is the most flexible simple shell scripting pattern I've ever found. You can also do stuff like ifconfig -a | egrep 'Link |inet ' | while read iface x;read x a x;do echo $iface $a##*; done italic ... italic to read the first and second line of each interface description from the ifconfig -a italic output (the egrep italic regular expression is set ot a couple of patterns that only occur on the first and second lines respectively). So we read each of those in our while loop using the variable x italic repeatedly to throw away the fields we're not interested in. Then we output just the interface name from the first line and just the IP address from the second line (stripping off the stuff up to the in that field using a bash italic parameter substitution). That's a trivial example but shows that the pipemill is not limited purely to consuming inputs oriented on single lines for each job. You can also throw away a header line using something like ps laxwww | read x; while read x u p ppid x x x x x state x x cmd args; ... done; italic ... here we throw away the header line printed by ps italic and we grab just the columns we're interested in (user PID Parent PID the process state themand's name or argv italic and the read of themand's arguments. This is handing for find italic zombies and killing their parents for example). The next productivity suggest enhances what I've already said. Use GNU screen italic ( GNU Screen - GNU Project - Free Software Foundation ) ... or tmux italic ( tmux ). I rmend the former for the same reason I rmend bash italic over its alternatives. GNU screen italic is installed on most Linux and other modern Unix-like systems by default. However this suggestion is weighted less heavily since you'll normally only be running console multiplexer ( screen italic or tmux italic ) on your local workstation or a preferred jump box or control tower system. The advantage of these systems is that you can maintain a persistent session with all your shell sessions connected to various different systems and running various programs all over the place. You can detach re-attach even allow others to connecte and share your session (obviously only your most trusted colleagues for you main session --- though you can also co-ordinate to run separate liaison sessions as necessary). GNU screen italic in particular also has some fairly advanced backscroll search and keyboard driven cut-n-paste features and macroing. In my daily usage pattern I maintain a notes editor in my first screen italic window. It runs vi italic with a macro for inserting the current date stamp using a single keystroke (F8 in my case). I almost always just work at the bottom of the file and let it grow arbitrarily large. Any time I exit the wrapper script around it mails me a copy. I use this for most of the cases where I would use fc italic (as described above) ... but I just leave the contents there (notes for the future) and paste the results into my other windows to execute asmands etc. When Imit changes to git italic I paste the output from git log italic into my notes; when I'm working on a Jira ticket I paste the URL into my notes (where I can go back right click on it and bring that back up later). When I edit a file on production system (if it's not under some sort of git italic or other version control) I paste a copy into my notes (and usually also into a Jirament). When I use some web based dashboard or work on something from PagerDuty or from any web based Nagios ( Check_MK Thrux Opsview) italic front end I paste the ReSTful URLs into my notes. Gnu screen italic uses vi italic -keybindings for most of its scroll buffer operations and similar features by default. So using it also builds on the same principles that I mentioned earlier. Master vi italic and use those bindings in your shell and everywhere else that the readline italic libraries allow it (via the ~ italic settings for example). I enable them in iPython italic as well. I also frequently use iPython italic for munging data into some form I can use for all this other work. For example on my current contract my boss ends up with various Excell spreadsheets from which he needs to extract data. I usually just export those to .CSV read and parse them in an interactive session and write the results out as . In one recent case he had to versions of the same spreadsheet (last month and current) and wanted to know which hosts has been added or removed from one to the other. It only takes a couple minutes to read in both extract that column from each storing each in a Python set() italic and then take the differences in each direction and finally print the sorted results from each (paste into my notes and into the e-mail response for him). In another case he a long spreadsheet listing every incident of server downtime across our production clusters for the last three monts and he wanted to know which systems appear most often in that list. (This is basically what you'd get by piping just the relevant portion through sort | uniq -c | sort -nr | head -n XX italic ... but in this case I did it using the Python italic class and its .mostmon() italic method). (I also used iPython's italic %save italic mand to save that session and whip the history into a script file for him to re-use from now on with similar data). For another case I used data from a table (Tab-delimited in this case) to generate the 4 or somands necessary to create a new cluster of clusters. The columns in the table were hostnames (which I'd generated using pattern strings with numbers interpolated into them) OpenStack image and flavor IDs (like AWS AMI and designations) as well as some networking data and other parameters. I simply interpolated the fields from each row into a nova boot italic mand (analagous to an aws ec2 run italic mand) and wrote the results into a file. Then I attached the file to the Jira ticket and ran it from the appropriate environment. (Yes much of the editing had gone through my notes file as well). The fact that my script is attached to the Jira ticket gives apletely unambiguous statement of work for later review and was handy when I was asked to change the capacity of one of the cluster s (I was able to simply paste a copy of the relevant lines from my script into a new script search and replace witih the bigger flavor --- kill the old instances and spin up their replacements. Adding or replacing nodes is also easy for anyone on the team because they have the exactmands easily attached. Building a whole new environment (staging for for a different region) is similarly easy. All these work flow practices work together. Gives me time to amuse myself on quora while looking productive. )
What made former Linux users want to switch to Microsoft Windows and why?
I abandoned Linux because it was far too much work to keep it running. It just was a pain to have to fix all the weird problems that no one admits really happens. If you plug in an unknown USB device it canplete crash the entire machine because the Linux Kernel crashed. The desktop environment can freeze and crash for no visible reason. If I needed software that wasn't in the repository then I had to go search for it that was a failure right there but there is more to the story Once I found the software it would not run on my distribution 1 I then would have topile the software by hand (not something the average desktop user can do and it is something they never want to do 1 Then the software would often not run because my distribution has missing libraries or the libraries are different 1 I have to go hunting for libraries 1 Find a way to have both the old and new libraries live in the same OS (this was sometimes challenging) 1 Compile the source code again 1 Hope it works 1 Projects that were made on the most popularmercial software (Microsoft Office and Adobe Photoshop) often failed to open or work properly Open source replacement software (ex Microsoft Office and Adobe Photoshop) has a terrible user interface is clunky to use and is often missing features Some distributions are not updated very often so there is always the fear that a security fault or virus (there are plenty of viruses for Linux) could cripple yourputer or online accounts. Games are terrible on Linux. Im not a huge game player but its good to take the occasional break and gaming on Linux is so bad that I just can play it. Wine (the software emulator on Linux that emulates Windows) is terrible I literally never got any Windows app to work for me not even once. The Linux support forums can be a hostile place. Seriously if I dint perform the world best search to find that some had asked the same question ten years prior I could (and did) get bashed by a bunch go know-it-alls that didn't realize that the ten year old post was now invalid and that as aputer professional I already had performed all the newbie steps to troubleshoot the problem. The interface on all desktop environments (that I have seen) are still weird clumsy klutzy or otherwise bizarre and not polished to the extent that a 21st Century interface should look like (they look like 199s interfaces to me). WiFi can be frightening sometimes working and other times requiring arcane rituals to get a few data packets through yes I have an Ethernet cable no I only know where it is and I don't want to look for it Nvidia drivers and all other drivers that I want but don exist or don't work properly No I don't want to write my own drivers I don't want to fix the kernel I don't want to write my own apps I have already written and given away more than enough software for one lifetime I just want my OS to just work.
How do I check the OS version on a Linux command line?
Im going to be as gentle as I can. Simply it is time to start to learn to use the UNIX toolkit try typing themand man -k system code One of the hits you should get is the UNIX uname code mand. You can also read about it here Learn Uname Command in Linux with Examples s or check out uname(1) print system info s As I have said in other answers please stop do not pass go and borrow yourself a copy of Kernighan and Pike excellent The UNIX Programming Environment italic ( . italic UPE or ISBN-13 978-139376818). Chances are good your college library has a copy. Plus it is still in print and you can buy it from most large brick and mortar here in the USA and Europe much less online book stores or even download the PDF from Digital Library of Free & Borrowable Books Movies Music & Wayback Machine UNIX Programming Environment Brian W. Kernighan Rob Pike Free Download Borrow and Streaming Internet Archive s . You can run the exercises from xterm s on Linux under a terminal s iterm s process on mac OS or under the WSL subsystem s on Win1 how to run those is beyond the scope of this answer use google or your favorite search engine if you want more details for your own specific OS. Going through the exercises in UPE will teach about scripting using the UNIX shell and really learning the different and extremely rich set of UNIXmands. One of them being the man code mand itself.