Share technical know-how with other users, or help to promote Ubuntu
Share your development expertise and help shape the future of Ubuntu
- Report shows middle income Australians pay only 11% tax, GST extremely regressive http://t.co/aYz7nZJah3 #auspol 11:20:11, 2015-01-24
- Noam Chomsky Slams West’s Charlie Hebdo Outrage http://t.co/6uD9UmizVW 09:42:00, 2015-01-22
- Trickle-down economics does not work; leading to greater inequality and financial crisis: US Treasury report http://t.co/gljVKNiWDn #auspol 13:19:00, 2015-01-21
- Fools and their money are soon parted: ‘password’ and ‘123456’ keep top spot on list of most popular passwords http://t.co/bazPhYlbij 11:20:15, 2015-01-21
- 1 per cent of the world will own more than half its wealth by 2016: Oxfam report http://t.co/iqGhiATTFA 09:42:06, 2015-01-21
- Great Barrier Reef needs investment of at least $785m over 5 years to protect from pollution: report http://t.co/Cpq5ihzSaX #auspol 15:33:01, 2015-01-20
- less than 2% of all recorded acts of terror were based on religion; even fewer being committed by Muslim extremists http://t.co/co0kz4Mdnq 11:20:04, 2015-01-20
- Abbott govt wants to turn SBS into a fully commercial network by stealth http://t.co/Bs3X7GZTy0 #auspol 13:19:01, 2015-01-19
Important: In an entertaining example of poor timing, Taylor Otwell added the serve command back into the framework shortly after I published this. There is now no need to use this package.
Users of Laravel 4 will remember that it came with a fantastic little command:php artisan serve
This was a quick and easy shortcut to boot the PHP development server, and work on your Laravel application locally. However, Laravel 5 came along and the command was removed, and everyone was sad... Sure, you can boot the PHP dev server very easily, but I missed typing this command before I started work on a project. Call me sentimental...
So to replace this critical piece of functionality, I have built a simple little Laravel 5 package that adds our beloved command back in: valorin/artisan-serve.
First, install the package via composer:composer require valorin/artisan-serve
Second, update the providers array in config/app.php:'providers' => [ ... 'Valorin\ArtisanServe\ServeServiceProvider', ],
Third, run the command via composer:php artisan serve
- More Surveillance Won’t Protect Free Speech http://t.co/8rgN9R7xh4 11:20:10, 2015-01-14
- Your Computer Understands Your Personality Better Than Your Friends Do http://t.co/9wgnIJgc4s 09:42:06, 2015-01-14
- Internet speeds: Australia ranks 44th, study cites direction of NBN as part of problem http://t.co/SUINPJTKPU #auspol 17:27:15, 2015-01-12
- Channeling Positive Tablet Usage To Foster Childhood Development http://t.co/AUPzuVT6Bd #edutech #edtech 15:33:00, 2015-01-11
- No gays, no blacks, no fat people: film advertising betrayals http://t.co/kEehdtQtoM 11:20:13, 2015-01-10
- Repeat after me: the Australian economy is not like a household budget http://t.co/GLjP5KkViX #auspol 17:27:06, 2015-01-09
- Anti-piracy organisation caught breaching copyright http://t.co/0uL7fn4lEf 09:42:00, 2015-01-09
- Should we be tracking our children? http://t.co/Czo7LodhbM 19:32:09, 2015-01-08
- Toyota has announced that it will freely share almost 6,000 patents it owns covering hydrogen fuel cell technology. http://t.co/1xE7WSBwRM 17:27:08, 2015-01-08
- This person isn’t just a nutter — she is responsible for putting countless lives at risk. http://t.co/oBp03ZiFwe 18:32:27, 2015-01-07
- A history of video games in five anecdotes http://t.co/4Qu2nN2Q1c 15:33:00, 2015-01-07
- I returned from holiday a couple of days ago and am catching up on messages. I have a replacement phone, so I can take calls again. 09:42:07, 2015-01-07
- Children with access to smartphones, tablets in bedroom get less sleep, US study finds http://t.co/IHB09TNXvh #edutech #edtech 09:42:02, 2015-01-06
- How to get the most out of 2015 http://t.co/BPSi6NEyfg 11:20:03, 2014-12-30
- RT @neiltyson: On this day long ago, a child was born who, by age 30, would transform the world. Happy Birthday Isaac Newton b. Dec 25, 1642 08:43:13, 2014-12-30
- My phone was stolen a few weeks ago in Vietnam. Enjoying the silence until I return to work and get a new one. E-mail if you need me. 10:51:05, 2014-12-29
- I never thought I’d be feeling safer here in Cambodia than back home in Sydney 21:10:44, 2014-12-15
Anyone who works with Linux servers will have used SSH. It's the stable of server management and cannot beat a GUI. The only downside with SSH is when you're on a slow or intermittent connection, and your SSH connection keeps dropping out or locking up. It's not fun at all...
Enter Mosh. Mosh replaces SSH and allows connections to disconnect and lag without affecting the user. It doesn't lock up, and tells you when you've lost server connection - so you know what's going on. When it gets connection back, so do you. It runs in the local account on both sides of the connection, which means you don't need an extra service running, and any user on the machine can use it. SSH is used for the initial authentication, so all your password, keys, and port forwards will still work.
Mosh has one downside: it uses a unique UDP port for each connection, and by default expects UDP ports 60000 - 61000 to be open and ready to be used. It doesn't reserve them, it just uses them when it needs to. From a security point of view, this isn't good. It's not that I think Mosh has security vulnerabilities, but if I open up those 1,000 ports on my server - anything else on the server can pick one and bypass my firewall... which is bad.
So, what can we do about it?
Since I use UFW as my firewall of choice on a Ubuntu server, I decided to see if I could write a script that automatically opens the ports that Mosh needs when it needs them, and closes them again when it's finished.
Something like this should do the trick:
What the script does is quite simple:
- It checks what ports are open for mosh-serv (line 4).
- Loops through each of the open port numbers (line 8).
- For each port, it checks if the port is allowed in UFW (line 10).
- If it's not, then it allows it (line 13).
- Then it loops through each of the UFW allowed ports (line 18).
- Checks if there is a mosh-serv process that has it open (line 23).
- If not, it closes the port through UFW (line 26).
The result is that only the active Mosh ports are open.
This could be run via cron every minute, but you'd need to get lucky when starting a Mosh connection, so it's far better to run it on each user login. However, there is a problem with this... notice the sudo commands? The user doesn't want to type their sudo password on each login, so we need to get creative here.
Save the script somewhere global, such as /usr/local/bin/mosh-allow-ufw, and then add a line into /etc/sudoers:valorin ALL=(ALL:ALL) NOPASSWD: /usr/local/bin/mosh-allow-ufw
Follow it up with an entry into your ~/.bashrc file, which will trigger it on each login:sudo /usr/local/bin/mosh-allow-ufw
In theory, you should now be able to Mosh into a server, and the server will automatically open the ports, and then Mosh will run. The only open ports will be those in use by Mosh. Rather than 1,000 ports open, we will only have one per connection.
Finally, to sum it all up, and because I am a big Ansible fan, we can automate the entire process.
There we have it: Mosh and UFW, without needing 1,000 ports open! :-)
- The best way to debunk myths
- The ‘pink vs blue’ gender myth
- Why you love to hate some friends
- Why we work without pay
- Scientists dismiss Julie Bishop’s claim to Obama Great Barrier Reef not at risk
- Abbott considered to be a nutter by senior conservatives http://t.co/UJVd8KvRwK #auspol 15:33:04, 2014-11-21
- More broken promises #auspol http://t.co/z2AEQLp3SC 13:19:08, 2014-11-21
- Sydney’s Pitt Street Mall back in world’s top five shopping strips http://t.co/fNs0QBP0g7 11:20:04, 2014-11-21
- Tony Abbott, the ABC and SBS: when election promises become lies http://t.co/ixfqEg2qzw #auspol 09:42:01, 2014-11-21
- @TransportforNSW when are you going to actually act against antisocial behaviour on trains? Police do nothing and announcements are a joke. 06:40:30, 2014-11-21
- @TransportforNSW when do you plan on actually doing something about the smoking addicts on trains and at stations? Announcements are a joke. 06:39:33, 2014-11-21
- The irony behind Julie Bishop’s success at the United Nations Security Council http://t.co/uvyPeG6KzU #auspol 19:32:32, 2014-11-20
- Banking culture breeds dishonesty, study finds http://t.co/O6d3HRLnEs 17:27:01, 2014-11-20
- Gamification of the LMS – A Step Towards Evolution of the Modern LMS http://t.co/iTJRZBrXZu #edutech #edtech 11:20:06, 2014-11-20
- How have UK teacher workloads changed over the past 25 years?
- Banks using social media to assess loan applications
- The co-operatives and mutuals sector makes the same contribution to the Australian economy as the mining sector http://t.co/ajKPOwUhwB 17:27:02, 2014-11-19
- How Australians see themselves in the world: results from over half a million responses to the ABC’s G20 quiz http://t.co/C9pFh9kAA2 13:19:02, 2014-11-19
- The CEO Of A Billion-Dollar Startup Uses This Trick To Feel Successful In Work And Life Every Week http://t.co/U026GPAGQs 17:27:00, 2014-11-18
- China free trade: is there a devil in the detail? http://t.co/XhAQyF9pZY #auspol 15:33:00, 2014-11-18
- Why Citi Got Rid of Assigned Desks http://t.co/5lnLLjfJ9K 19:32:01, 2014-11-16
- RT @annazivarts: Brilliant visual of how much public space we cede to cars http://t.co/2fE0GNWlwK ht @mikefarrell 13:19:01, 2014-11-16
- Abbott’s idea of a shirtfront involves a smile and an #MH17 congratulatory handshake http://t.co/0TRXJ3VECX #auspol http://t.co/pZBj06FYCK 11:20:07, 2014-11-16
- Abbott claims terra nullius: describes Sydney as ‘nothing but bush’ before First Fleet arrived in 1788 http://t.co/jBaTU72poa #auspol 09:42:00, 2014-11-16
- FBI’s most-wanted cybercriminal used cat’s name as password
- Australian Navy Struggling To Tow Back Russian Warships http://t.co/CMDcd91nbj #satire #auspol 17:27:02, 2014-11-15
- ‘Weird’: Abbott’s opening #G20 address under fire
- FIFA’s own ethics investigator disputes report conclusions
- Rio Tinto CEO lauds US-China climate deal, calls for Australia to catch up
- How a dictator created the national dish of Australia http://t.co/VfZFqJeM9u 11:20:05, 2014-11-13
- Pollution killed 1.2 million Chinese people in one year alone while Abbott says coal is “good for humanity“
- RT @auxesis: “It’s not a promotion — it’s a career change”. Some thoughts for new or aspiring engineering managers http://t.co/ttNCkWTWVX 09:42:03, 2014-11-12
- The changing laws of the jungle and your career http://t.co/kfwfUCJQik 05:57:59, 2014-11-12
- I’m declaring my online independence today. Join me! #ChooseIndependent with Firefox. http://t.co/PnYiAYnpei 05:01:17, 2014-11-11
- I’m against secret companies being used to smuggle stolen money for the corrupt. #G20, it’s time to #UnmaskTheCorrupt http://t.co/0gc8CuxXeq 21:01:18, 2014-11-10
- The world is moving on #climatechange … 39 countries are putting a price on carbon http://t.co/zA0xf7gIAr 13:19:09, 2014-11-10
- When We Don’t Like the Solution, We Deny the Problem: study http://t.co/AjOpe2QQqT 11:20:07, 2014-11-10
- 343 Australian & foreign companies have used tax havens in recent years to dramatically cut their tax bills http://t.co/LeP6gYKUDj #auspol 09:42:04, 2014-11-10
- RT @TheCloudNetwork: Cloud Architecture Daily is out! http://t.co/mfq2QO8Bov Stories via @JulianneSeo @sridhardha @TechJobsUSA 11:16:03, 2014-11-09
- Avoid the dangers of an accidental cloud architecture http://t.co/8x8OM82f8U 15:33:03, 2014-11-08
- How companies try to scam you: the top 10 ACCC court cases
- Australia: First to Mainstream Impact Investing? http://t.co/MwPUq181iE 19:32:13, 2014-11-06
- NSW Attorney General steals from gang-rape victim http://t.co/OllredWl25 #nswpol 17:27:04, 2014-11-06
- Abbott government losing favour with business community http://t.co/fWcQHaUzkf #auspol 09:42:04, 2014-11-06
- Considering significant contributions made by migrants to Australia, maybe we ought to rethink our cruelty? http://t.co/2sj1CLotVI #auspol 11:20:03, 2014-11-05
- Housing bubble debate: Dwelling shortage may not be as bad as believed http://t.co/t9PCMu4Iws 09:42:01, 2014-11-05
- Asylum seekers allegedly tortured, threatened with rape in secret compound
- Students may be adept at tech for personal use, but they still need guidance to solve real problems http://t.co/e4fmIwjRqN #EduTech #EdTech 13:19:08, 2014-11-03
- Greenhouse gas levels at highest point in 800,000 years: comprehensive UN report
- Here’s What Happens When A School Pays Its Teachers A Lot, Lot More Money http://t.co/ImgJRmTNB1 09:42:02, 2014-11-03
- How a small change can have a big impact: an example from nature http://t.co/pcWp1PwGnR 09:42:08, 2014-11-02
- Forget sorry, for Mathias Cormann tax is the hardest word to say in parliament
- Evolution is real and God is no wizard, says Pope Francis http://t.co/svvh3OOa3I 11:20:01, 2014-10-30
- Govt bypassing environmental impact assessments for Great Barrier Reef Abbot Point spoil dumping in wetlands http://t.co/vXtK6UDLdu #auspol 09:42:00, 2014-10-30
- Can data predict the perfect entrepreneur?
- ‘Anti-Facebook’ Ello investors dig deep
- Silicon Valley’s billion dollar failures
- Silicon Valley’s billion dollar failures
- Abbott govt wants to cut family support for over a million Australian families, costing $3000/yr per family http://t.co/tz4d6PoTv1 #auspol 13:19:00, 2014-10-27
- Have Jedis created a new ‘religion’? http://t.co/u9oMEgVGPh 11:20:12, 2014-10-27
- Victorian school fights to keep secular support worker against Abbott govt theocracy
- Queen’s Bohemian Rhapsody ‘good song if unwell or down’ http://t.co/d04mah8OUX 19:32:19, 2014-10-26
- The Sobering Facts About Egg Freezing That Nobody’s Talking About http://t.co/ycmIu8zW0e 17:27:06, 2014-10-25
- Apple co-founder Steve Wozniak accepts adjunct professorship at UTS http://t.co/443oPiWzLH 15:33:03, 2014-10-25
- Government’s free plug for Tourism Minister Andrew Robb’s family restaurant
- Green Economy Index 2014: Australia ranked last for leadership http://t.co/o1if4Ps2k2 #auspol #climatechange 13:19:09, 2014-10-21
- Coalition backs friends of the party with appointments on powerful boards http://t.co/lHVRehy6Qn #nswpol #auspol 11:20:07, 2014-10-21
- What to leave behind in the health food aisle http://t.co/WCwjPXeAZu 09:42:01, 2014-10-21
- Baird government opens door to potential pokie palace childcare centres
- RT @officialbhoy: Er.. Let’s play ‘spot the headline which probably should be bigger?’ http://t.co/33zB8Xx4S7 20:30:32, 2014-10-18
- Putin: MH17 was just a taste of what lies in store http://t.co/q1M1wNBJwl 11:20:05, 2014-10-18
- Photos of appalling conditions in Australia’s Manus Island concentration camp http://t.co/czNboq2OSY #auspol http://t.co/rYP6jxGVr4 09:42:03, 2014-10-18
- Leak of Trans-Pacific Partnership Agreement shows world govts selling consumer rights to corporations http://t.co/SeZK4u8rsP #ReleaseTheText 15:33:00, 2014-10-17
- The best way to balance the budget is to make the top end pay their fair share http://t.co/1NqAzZ1wJS #auspol http://t.co/UvrWaG8WSY 13:19:02, 2014-10-17
- NSW Liberals in grassroots revolt as former minister Jackie Kelly quits; no different from when Labor ruled http://t.co/U7c8Vkjaps #nswpol 09:42:04, 2014-10-17
- Microsoft Word Spellcheck Not About To Just Let You Change From US Spelling http://t.co/bvccshCxEs #satire 19:32:15, 2014-10-16
- China’s influence over Australian Chinese-language media outlets growing, analysts say http://t.co/KpHhVYzV4z 17:27:07, 2014-10-16
- Australia pledges to halt loss of native mammal species by 2020 http://t.co/PRaOrLHkwp 15:33:02, 2014-10-16
- The Australian’s Media Editor asserts no bias in Murdoch press http://t.co/uDNaaOCEg7 #auspol http://t.co/lRvy4X11Mg 13:19:01, 2014-10-16
- NSW Premier appears in News Corp advert, makes clear that Rupert owns the LNP Coalition http://t.co/20N3SQDXe3 #auspol #nswpol 11:20:03, 2014-10-15
- NSW Police struck deal with church to cover up abuse
- Commonwealth Bank, BankWest, Arnott’s, S26, Thermomix, Kmart, Amazon Kindle win Choice’s Shonky Awards
- NSW premier set to announce reforms to tackle corruption in govt — let’s keep the bastards honest! http://t.co/eh6BpmJKqp #auspol #nswpol 15:33:01, 2014-10-14
- Sea levels steady for millennia before rapid rise: study
- Australia needs to be fairer if it wants to be richer
- Millions of Australians living in poverty: ACOSS
- Joe Hockey welcomes #MH17 murderer of 38 Australians (298 total), Vladimir Putin, to Australia http://t.co/bdP94XAsGJ #auspol 15:33:01, 2014-10-12
- Malaysia Air MH17 passengers knew they would die. Putin must be stoked at getting away with it http://t.co/rAT3DoSnZB http://t.co/eM6rMIAMgG 19:32:03, 2014-10-11
- Federal Govt locks in ‘cloud first’ stance http://t.co/Ol1hEgIaIf 19:32:07, 2014-10-10
- Now we know where Tony Abbott gets his ideas on technology and family from http://t.co/TNSKt7wdt8 #auspol #video 17:27:01, 2014-10-10
- International surrogacy is ‘new frontline in human trafficking’: judge
- Cane toads evolving into straight, fast hoppers
- 10 October is World Mental Health Day — have you made your mental health promise yet? http://t.co/uSc0ZhG0uH 07:33:12, 2014-10-10
- Cyclists break the law due to safety concerns, study says http://t.co/dD00aKaToI 22:59:21, 2014-10-09
- NSW Health report: GP co-payment would crush NSW emergency departments http://t.co/K9hCfgb1M0 #auspol 20:42:10, 2014-10-09
- Quiz: how good is your English? http://t.co/7SNEx4Xff2 19:32:07, 2014-10-09
- Joe Hockey: “It is important that everyone does their fair share.” Let’s start with corporate tax dodgers http://t.co/zaqXkNAwHM #auspol 17:27:04, 2014-10-09
- Canberra the best place to live, in the world’s best country: OECD http://t.co/GZMCUBOFg8 20:42:04, 2014-10-08
- Senate considers greater oversight for companies, councils and other orgs accessing metadata without warrants http://t.co/0ANkGkwqfH #auspol 20:42:01, 2014-10-07