#Why does the terminal keep trying to use ubuntu why does it keep closing before i can choose gcc
Explore tagged Tumblr posts
saintly67 · 3 days ago
Text
There is always some fucking issue when im setting up vscode for a new project..........
0 notes
phooll123 · 7 years ago
Text
How to set up an iPad for web development
A few months ago, I detailed my process for setting up a Pixelbook to code on. It wasn’t easy or simple or straightforward, but it worked in the end: I had all the power and flexibility of Linux, access to my favorite code editor (VS Code), and, of course, the slick web browsing experience that Chromebooks are known for.
Around that same time, I attempted to set up an iPad for coding. I failed miserably. I love using the iPad for writing and other creative work. It’s super portable, has great battery life, an excellent screen, and the limited multitasking keeps me focused. Unfortunately, it’s very bad for complex tasks and intentionally crippled for software development.
But I’m older and wiser now, and after an entire Saturday spent bashing my head against a wall, I’m happy to report that I can use a $799 tablet computer to write software. Will I ever actually use it for this purpose? Maybe! But we’ll get to that.
Feel free to follow in my footsteps if you, too, wish to code on the iPad. I can’t promise you it’s a worthwhile destination, but I learned a lot on my way there.
Chapter 1: The journey begins by lowering my expectations
As everyone knows, Apple is scared to death that anyone might ever run arbitrary code on one of its pristine iOS devices. It makes a little bit of sense: the strictures of iOS and the App Store are why a years-old iPad is vastly more responsive and cruft-free than a similarly aged MacBook Pro.
But it makes developing software nearly impossible. It’s ironic because the iPad is excellent for creators in so many ways like drawing, design, and music. Under the hood is the same Unix kernel that makes macOS excellent for programmers.
Anyway, you know all this.
Unlike on the Pixelbook, where I wanted a full-on Rust development environment basically comparable to my Mac setup, I decided to just do some JavaScript-based web development on my iPad.
I knew just the place to go: CodeSandbox. It’s a website, and everything runs in the browser. Therefore, the iPad won’t be able to stop me from my dreams of creating my “Calculator 2: The Sequel to Calculators” web app in JavaScript.
CodeSandbox allows you to use arbitrary NPM packages, and it has a code editor based on VS Code’s own editor. So as long as you stick to the world of JavaScript, it’s almost as powerful as a traditional desktop-based web development setup. CodeSandbox also sands off some of the rough edges of configuration files and has a lot of premade projects built with various technologies (React, Vue, Redux, and even exotic frameworks like Hyperapp), which makes it easy to get started with the uber-complicated build chain that modern web development seems to require.
And I was extra excited to see that CodeSandbox has a Vim mode. Vim keybindings are my preferred way to navigate around text, and it’s especially important on the iPad where you don’t have a mouse for assistance. Moving the cursor, highlighting text, deleting words or lines, moving lines, and jumping large distances in a file all require just a couple keystrokes in Vim. Contrast that to the iPad alternative: seconds spent poking at the screen with your clumsy finger, hoping iOS will discern your intent.
Basically, everything was going great. CodeSandbox was all I needed, and my iPad was suddenly an ultra useful webdev box — at least for building the sort of small experiments I gravitate toward.
Except there was one problem: the iPad doesn’t have an Escape key.
Chapter 2: What despair feels like
See, in Vim, there are different “modes.” There’s the default mode where you use the keyboard to navigate around your document. There’s the selection mode, where you use those same navigations keys to select text. And, importantly, there’s an insert mode, where you use your keyboard to type. Since you need to get out of insert mode to move your cursor again, you need some sort of command to exit insert mode. By default, that command is wired to the Escape key.
Many Vim users (like myself, for instance) map a fancy key combo like “jj” to make exiting insert mode easier, but CodeSandbox isn’t actually Vim. It just emulates some of Vim’s default keybindings. So I need an Escape key. And the iPad doesn’t even know what that means.
I’m serious! At first, I thought this was just a problem with Apple’s own Smart Keyboard Cover, which has no function row and no Escape key. So I pulled out a regular Bluetooth keyboard and hooked it up to the iPad. I jammed on the Escape key and... nothing. In the world of iOS, there is no escape.
I browsed around StackExchange and various GitHub issues in a state of despair. Yes, there are ways to emulate an Escape keypress with “Ctrl + [,” but that gets me nothing in this case. I’m stuck in insert mode for the rest of my life.
CodeSandbox, you brought me so close!
In fact, based on CodeSandbox’s rapid iteration, I wouldn’t be surprised if they solved this issue in the near future.
But in the meantime: what’s a boy to do?
Chapter 3: Okay, let’s try the cloud again
The first time I tried to set up an iPad for coding, I naturally went straight to the cloud. But the cloud isn’t a magical place where all your dreams come true. Setting up a devbox on Digital Ocean or Google Cloud requires some knowledge of Linux and SSH, and there’s no GUI Linux interface to fall back on when your command line skills fail you.
Why was this so hard before?
Weirdly, the debris of scattered knowledge from my last attempt at a cloud devbox setup was all I needed to quickly get everything working. I paid for the basic $5 box on Digital Ocean, put a clean install of Ubuntu on it, and provided it an SSH key I generated in Panic’s Prompt app, an SSH terminal emulator for iOS. Why was this so hard before?
After SSHing into my Digital Ocean box, I started adding the tools I need. I installed Neovim (a modern Vim alternative) and found someone’s .config file for Neovim on GitHub and copied it. Then I installed nodejs, yarn, npm, parcel, rust, gcc... all the good stuff I crave. Because the “language server” aspect of VS Code is open source, I can get many of the hints and errors I rely on so heavily when coding into Neovim, even though it lacks all the GUI bells and whistles of VS Code.
It’s hard for me to describe how I did all these things, other than a liberal application of sudo apt-get install, copying and pasting shell scripts, and careful reading of error messages. Mostly, it’s just years of trial and error in the command line. I guess DM me if you get stuck on something, and I’ll do my best to help. Have you tried modifying your $PATH?
So, anyway, now I can write a web app in JavaScript, serve it from my Digital Ocean box, and preview my work in Safari (with live reload, thanks to some magic performed by Parcel). I can even split-screen the terminal and Safari and reallyget to work.
But soon, I got frustrated: a very small fraction of my work “coding” is actually typing code. I spend most of my time reading documentation and other people’s code to try and figure out how the hell anything ever works. After a couple of minutes browsing StackOverflow, I get a notification from Prompt, warning me that my SSH session is about to disconnect because of inactivity.
The whole reason iOS is so nice and responsive is because it has almost zero multitasking unless you’re working with multiple audio apps at once. Prompt does its best to stay alive, but iOS always kills it in the end.
Chapter 4: UDP saves the day
So, I Googled for a solution and discovered Mosh. Basically, Mosh is a UDP protocol for using a terminal from an intermittent connection. You connect over SSH like usual, but then that connection is handed off to Mosh to keep it “alive” during downtime. Prompt doesn’t support Mosh, so I paid another $20 for another terminal emulator app, called Blink, and set up Mosh. It took some trial and error to get the Mosh server running on my Ubuntu box and correctly enter my login details into Blink, but once I got it working, it works great.
I can leave the terminal for days, and as soon as I open Blink I have all the sessions open from the last time. For command line warriors, this is no huge feat. They know all about “reattaching” to sessions or whatever they do. But for me, it’s a huge achievement.
In fact, in some ways, I prefer my iPad / Blink / Digital Ocean setup to coding on my Mac. I can’t do everything my Mac does — anything involving windowing or graphics, for instance, outside of a web browser, isn’t really possible — but I have the joy of knowing I’m not mucking up my Mac with all the various weird command line software I install from the internet. If my setup ever breaks beyond repair, it’s just a couple clicks to wipe my Ubuntu box and start fresh.
Also, while my Digital Ocean box is a lot slower than my MacBook Pro, it has a blazing-fast internet connection. Anything I want to git clone or npm install feels way snappier on this cloud box, thanks to its minimal latency and huge internet pipe.
Only one problem: I’m terrible at JavaScript
Oh, and in case you were wondering: Blink supports the “Ctrl + [“ command to emulate escape. You can also map your Caps Lock key to escape if you want to be really crazy (I traditionally map Caps Lock to Ctrl, which is also supported by Blink). But, thankfully, my Neovim config maps “jj” to escape when in insert mode, so I’m golden on that front.
There’s really only one problem with my current setup: I’m terrible at JavaScript, and therefore nothing I write works the first time, and I can’t see any console error messages in Mobile Safari because it’s a crippled browser for babies.
CodeSandbox.io includes its own console interface.
I guess my first job on this new coding setup will be to write a pull request for CodeSandbox to support the “jj” escape method.
If only I was better at JavaScript!
It’s a real pickle I’ve found myself in.
via Blogger https://ift.tt/2upzJDH
0 notes
blogmojodojo · 8 years ago
Text
How to Fix Windows and Linux Showing Different Times When Dual Booting
Your computer stores the time in a hardware clock on its motherboard. The clock keeps track of time, even when the computer is off. By default, Windows assumes the time is stored in local time, while Linux assumes the time is stored in UTC time and applies an offset. This leads to one of your operating systems showing the wrong time in a dual boot situation.
To fix this, you have two options: Make Linux use local time, or make Windows use UTC time. Don’t follow both steps of instructions or they still won’t be speaking the same language! We recommend you make Linux use local time, if possible.
Option One: Make Linux Use Local Time
Making Linux use local time the same way Windows does is probably the best option. Windows does have a registry setting that forces it to store the time as UTC, but it reportedly isn’t well supported and can cause problems with some third-party applications that always assume the hardware clock is in local time. It’s also incompatible with Windows’ own Internet time-syncing service.
The steps to make your Linux system use local time can vary from Linux distribution to Linux distribution. However, on any Linux distribution with systemd, you can use the timedatectl command to make this change. This will work on modern versions of Ubuntu, Fedora, Red Hat, Debian, Mint, and other Linux distributions that use systemd.
To make this change, first open a Terminal window on your Linux system. Run the following command to put the real time clock on the motherboard into local time. Linux will store the time in local time, just like Windows does.
timedatectl set-local-rtc 1 --adjust-system-clock
To check your current settings, run:
timedatectl
If you see “RTC in local TZ: yes”, Linux is set to use the local time zone instead of UTC. The command warns you that this mode is not fully supported and can cause some problems when changing between time zones and with daylight savings time. However, this mode is probably better supported than the UTC option in Windows. If you dual-boot with Windows, Windows will handle daylight savings time for you.
If you ever want to undo this change, run the following command:
timedatectl set-local-rtc 0 --adjust-system-clock
Option Two: Make Windows Use UTC Time
Making Windows use UTC time like Linux is probably not the best option. You can edit the registry to make Windows use UTC time, but this could potentially cause more problems than just making Linux use local time.
If you do want to do this, you’ll first want to disable the Internet time updating feature on Windows. This ensures Windows won’t set the clock incorrectly when trying to sync the current time from the Internet. On Windows 10, head to Settings > Time & language and disable “Set time automatically”. On Windows 7, right-click the system clock in the taskbar and select “Adjust date/time”. Click the “Internet Time” tab, click the “Change Settings” button, uncheck the “Synchronize with an Internet time server” option, and click “OK”.
Make Windows Use UTC Time By Editing the Registry
First, open the Registry Editor by clicking Start, typing “regedit”, and pressing Enter. Agree to the security prompt that appears.You will now need to add the appropriate value to the Windows registry. Here’s our standard warning: The Registry Editor is a powerful tool and misusing it can render your system unstable or even inoperable. This is a pretty easy hack and you shouldn’t have any problems as long as you follow the instructions. That said, if you’ve never worked with it before, consider reading about how to use the Registry Editor before you get started. And definitely back up the Registry (and your computer!) before making changes.
Navigate to the following key in the left pane of the registry editor:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation
On the latest versions of Windows 10, you can copy and paste the above line into the address box. However, this hack will work on Windows 7 as well.
Right-click the “TimeZoneInformation” key and select New > DWORD (32-bit) Value.
Name your new value RealTimeIsUniversal.
Double-click the RealTimeIsUniversal value you just created, set is value data to 1, and click “OK”.
You’re now done, and you can close the Registry Editor. Windows will store the time in UTC, just like Linux does.
If you ever want to undo this change, return to this location in the registry, right-click the RealTimeIsUniversal value you added, and delete it from your registry.
Download Our One-Click Registry Hack
If you don’t want to edit the registry yourself, you can use our downloadable registry hack. We created one hack that makes Windows use UTC time, and one that restores it to local time. Both are included in the following ZIP file. Just download the file, double-click the hack you want to use, and agree to add the information to your registry.
Make Windows Use UTC Time
The above hacks do the same thing we described above. The Make Windows Use UTC Time hack creates the “RealTimeIsUniversal” entry with a value of “1”, while the Make Windows Use Local Time hack deletes the “RealTimeIsUniversal” entry.
If you ever want to see what this or any other .reg file does, right-click it and select “Edit” to view the file in Notepad. You can easily make your own registry hacks, which just consist of a list of registry entries to add, edit, and remove in a properly formatted list.
If you’re wondering why Windows uses local time instead of UTC like other operating systems, official Microsoft blog The Old New Thing explains it here. In short, it was to preserve backwards compatibility with Windows 3.1 systems and to prevent people from getting confused when they set the time in the computer’s BIOS. Of course, PC manufacturers chose local time to be compatible with Windows and Windows chose local time to be compatible with the decision PC manufacturers chose, so the cycle became self-reinforcing.
There’s currently no standard for labeling whether a time is stored as UTC or local time in BIOS or UEFI firmware, which would probably be the most logical solution. But it would require some work, and most people will never even notice different operating systems use different time formats—except in dual-boot configurations.
from Blogger http://ift.tt/2jy8Lod via IFTTT
0 notes
johnstibal · 8 years ago
Text
Software + Hardware, a Good Strategy for Software Firms?
Software firms often reach a point where maintaining early growth becomes a challenge. Reaching a point where their applications have been lost in the IOS / Google Play store among 'me too' competitors, struggling to reach profitability given the 30% transaction cost of the app stores, many firms are increasingly looking at alternative routes to market.
B2B?   B2B2C?   Hardware?   Strategic partners?   Wearables?   Software-defined objects?   In other words, atoms + bits + cloud?
Yes, all of these can be very good options to explore when searching for an alternative go to market strategy, provided a few potential traps and misconceptions should be avoided before launching down each route.
Myth #1:    Hardware is hard... Yes, correct, hardware can be hard, if your team lacks the right expertise and strategic partners to help you achieve your vision. This is solvable.
Myth #2:    Spending $ millions to create hardware design molding, and endless testing and certifications could never be a good choice for your small startup company... No. A typical hardware project does not need to spend millions or even hundreds of thousands in most cases, even if high quality product development work is not free. By adopting the right development approach from the start, usually development cost, for other than highly miniaturized wearables, are typically well below $100 K. This amount includes all of the nonrecurring engineering and project development costs. As you will find, development costs tend not to be more than the comparable efforts and costs to create great software.
Bear in mind these key principles from the start.
Build upon and customize existing hardware and boards, if at all possible
Any aspiring 'Steve Jobs' protégé (and we love them all) always wants to build everything new from scratch. Sexy new technology is brilliant, no doubt, and we understand the temptation. This is great - - but, if at all possible, try to be pragmatic and focused at the start of developing your first generation product. Save your best groundbreaking approaches for your second generation product. Invariably, there will be massive learning, relationships, and investor confidence built by shipping a good first gen. product on time. This will lead to far stronger and more robust products in the future.
Nearly any electronic device imaginable exists is various forms. You just need to find it!
Perhaps your dream product was already developed for a different industry, or another part of the world? Maybe it exists as two separate devices, just needing to be combined? Possibly, a near perfect device is already sitting on the R&D shelf of a major manufacturer in China having 80% of your target functionality. You simply would need to upgrade the Printed Circuit Board (PCB) and Processor, add a few new sensors, with some nano-tech waterproofing, and combine it with your great software. As is the example in this case, finding a close 'baseline' device which meets most of your device requirements will save hundreds of thousands of dollars, and cut development / product times down to literally three to six months.
Incorporate components using a building blocks approach which are already produced in mass quantities (before your competitors does).
Billions and billions of mobile phones and tablets devices have been built over time. Year on year the raw CPU power withinthese devices gets cheaper and more powerful (and will continue for the foreseeable future).  Android and Ubuntu Linux O/S running on mobile devices are solid and stable, and free to use. GPS and sensors give context, making other data vastly more valuable. Wifi / 3G / 4G unlocks unlimited cloud-based storage and processing power. Using the availability of these components to your advantage.
Myth #3:    Electronic devices, such as highly customized phones, tablets, and state-of-the-art specialized sensors, require in initial minimum order of > 100,000 or more units...  No, not true. This was true in the past, but its no longer required now. The manufacturing world has evolved to be far more flexible and competitive. Price competitive devices can be created with a unit volume of as low as a few thousand devices, and sometimes less depending what modifications are required.
As with any challenging project worth doing, nothing is free. This is not like ordering from Amazon either. However, if you have a budget of about $ 80 K and up devoted towards development of your dream product (i.e. going from slideware concept, user testing (FCC & CE, Google certifications - GTT, GMS, for mobile devices) to a golden pre-production sample), you can very realistically achieve your vision in most circumstances.
Myth #4:    Its impossible to decommoditize a commodity... Wrong, this is a big myth, top companies do it all the time. Not only is it possible, doing so unlocks substantial hidden value for those who do it well in an authentic transformative way. But, always keep in mind the power of your overall solution, not just the hardware itself. Products and bundles of functionality matter. Take Amazon's Kindle e-reader device as an example. This is a very nice product. Yet in nearly all of world, e-readers are viewed as a low cost commodity item - - except for Amazon. The Kindle product line serves as an important leg of its business. Why? For Amazon, the Kindle is one of its major store fronts, acting as a digital goods delivery vehicle for its most loyal customers. Its rumored Amazon sells the Kindle line of products at a 5% gross margin. This is far below typical margin levels seen for hardware at retail. Yet, this 'lost' margin is recovered, via the sale of everything else on top of the device unique to Amazon, demonstrating the power which the solution brings.
Another good example comes from those companies who build their product package around customized 7” to 15” inch Android or Ubuntu powered tablets. By combining great software, with a credit card swiper, wireless handheld bar code scanner, printer, and a durable stand, this off-the-shelf bundle makes an excellent Point of Sale (POS) terminal (at a fraction of the cost of older POSs and particularly those now relying on Apple's iPads). This same approach can easily evolve to be an excellent advertising kiosk, with a few minor changes. Moreover, add some specialized high-end audio headphones or wireless speakers, with a few large television screens, and now this bundle is suitable for many other uses. The combinations are endless.
Having worked closely with some of the leading factories and ODM's (an Original Design Manufacturer is a company which designs and manufactures a product which is specified and eventually branded by another company for sale) in China, they clearly are the workshop to the world. I am continually surprised by the types and breadth of baseline products just 'sitting on the shelf' available for quick use. This said, do not be fooled by this untapped and unfocused capability. Just because you can create a product quickly, this does not mean you should. Before launching a hardware project, always ensure whatever you do is authentic for your business. Does combining atoms + bits + cloud create a new pillar of your business? If you are a software firm, does your dream hardware product unleash 3x or more functionality from your software? Does it massively delight the user?
My most important guidance: be authentic with your software and your company. Only launch a hardware project if it unlocks true value add, creating a multiple of what an off-the-shelf consumer device can do running your software.
Myth #5:    My product does not need to be 'smart'... Maybe, maybe not. Always ask yourself what is your dream product and does its technology push the bounds of what is possible for the cost?Instead of being just 5% better than a competing product and costing a bit less, is it possible to be 10x better for half the cost? Could your product double its speed of use allowing the users to be twice as efficient? If yes, this becomings a transformative product, not just incremental, leveling up its potential.
Suppose you lead a product development team for a startup medical device maker. Instead of following traditional approaches to develop you next generation of lab test equipment, what if you design a new product which combines new many features and adopts new approaches. For example, new software (with learning algorithms), cloud-based processing, a printed circuit board and touch screen (repurposed from a phone or tablet device), added an array of newest silicon-based chemical sensors and a super high resolution camera to photograph each of the test samples. All of this would be designed to fit within an upgradable modular case allowing for easy adaptation to many different uses within a customer's lab. As described, all of this 'dream' hardware is very feasible to develop. Yet, by adopting this new approach, instead of it costing $25 K per unit (as under the old approach), your new medial testing device might now only cost$300. Moreover, it now comes with the added advantage of being able to track and connect wirelessly to everything else, fundamentally changing the workflow of a medical testing lab saving substantial personnel costs.
Check out brainstem.co.
0 notes