Author Archives: CooLMinE
How to keep your screen always on
On most systems this can be configured by going to Control Panel --> Power Options --> Choose when to turn off the display
, but there are always some situations that this solution will not suffice. As an exmaple, the last time I faced this problem, Active Directory’s settings were overriding my system’s settings, which caused my display to turn off every 5 minutes regardless of how much I tried to tweak it using the Power Options.
As a workaround I decided to create a small application that would just keep the screen from turning off. I decided to share it with you in case you ever find yourself in a similar position.
You can download the program here.
If you know a bit about programming you can take a look at the source code below that will give you an idea on how this is achieved.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | using System; using System.Runtime.InteropServices; using System.Windows.Forms; namespace ScreenAlwaysOn { static class Program { [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags); [FlagsAttribute] public enum EXECUTION_STATE : uint { ES_AWAYMODE_REQUIRED = 0x00000040, ES_CONTINUOUS = 0x80000000, ES_DISPLAY_REQUIRED = 0x00000002, ES_SYSTEM_REQUIRED = 0x00000001 } static NotifyIcon tIcon = new NotifyIcon(); [STAThread] static void Main() { SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS | EXECUTION_STATE.ES_DISPLAY_REQUIRED); ContextMenu menu = new ContextMenu(); menu.MenuItems.Add("Exit", delegate { Application.Exit(); }); tIcon.Icon = Properties.Resources.monitor; tIcon.Text = "Screen Always On"; tIcon.ContextMenu = menu; tIcon.Visible = true; Application.ApplicationExit += Application_ApplicationExit; Application.Run(); } static void Application_ApplicationExit(object sender, EventArgs e) { tIcon.Dispose(); } } } |
The theory behind this solution is very simple. We are using the SetThreadExecutionState windows function to notify the system that the screen should stay on.
Flags Descriptions
ES_AWAYMODE_REQUIRED (0x00000040)
Away mode should be used only by media-recording and media-distribution applications that must perform critical background processing on desktop computers while the computer appears to be sleeping. See Remarks.
ES_CONTINUOUS(0x80000000)
Informs the system that the state being set should remain in effect until the next call that uses ES_CONTINUOUS and one of the other state flags is cleared.
ES_DISPLAY_REQUIRED(0x00000002)
Forces the display to be on by resetting the display idle timer.
ES_SYSTEM_REQUIRED(0x00000001)
Forces the system to be in the working state by resetting the system idle timer.
Posted in C#, Software Releases.
Tagged fluxbytes, fluxbytes software, screen, SetThreadExecutionState
How to uninstall Microsoft Advertising SDK
Microsoft Advertising SDK is included in Visual Studio 2013 now. If you are lucky enough you might have an entry for it in “Programs and Features” which will allow you to uninstall it. Sadly for me, this was not the case as there was no visible way to uninstall it from my system.
One solution that allowed me to uninstall Microsoft Advertising SDK was to navigate to the packages folder that can be found in the Virtual Studio CD or .ISO file then look for the AdsSDK10 folder.
Inside you will find some .msi files, simply right click on the files then select “Uninstall”. If Microsoft Advertising SDK is installed on your computer the uninstallation process will begin.
Posted in Microsoft, Software Tips.
Tagged Microsoft, Microsoft Advertising SDK
GitHub Student Developer Pack
GitHub is now offering a pack aimed towards students completely free.
To be eligible for the pack you will need to be a student aged 13+ and enrolled in a degree or diploma granting course of study. You will need a school-issued email address, valid student identification card, or other official proof of enrollment.
The pack contains the following tools and products:
- ATOM — A hackable text editor for the 21st Century (text editor)
- bitnami — Business 3 plan (normally $49/month) for one year (hosting)
- CrowdFlower — Access to the Crowdflower platform (normally $2,500/month (data enrichment platform)
- Digital Ocean — $100 in platform credit for new users (hosting)
- DNSimple — Bronze hosted DNS plan (normally $3/month) for two years (hosting)
- GitHub — Micro account (normally $7/month) with five private repositories while you’re a student
- HACKHANDS — $25 in platform credit (Live programming help available 24/7)
- Namecheap — One year domain name registration on the .me TLD (normally $8.99/year & One year SSL certificate (normally $9/year) (domain)
- Orchestrate — Developer account (normally $49/month) while you’re a student (API platform that powers multiple databases-as-a-service for developing Web and mobile applications)
- Screenhero — Individual account (normally $11/month) while you’re a student (Screen sharing for collaboration in teams)
- SendGrid — Student plan 15K free emails/month (normally limited to 200 free emails/day) while you’re a student (email service)
- stripe — Waived transaction fees on first $1000 in revenue processed (Web and mobile payments)
- Travis CI — Private builds (normally $69/month) while you’re a student (hosted integration platform)
- Unreal Engine — Unreal Engine (normally $19/month) while you’re a student (game engine)
Click here to apply for the GitHub student developer pack !
Posted in Tech News.
Tagged ATOM, bitnami, CrowdFlower, Digital Ocean, DNSimple, GitHub, HACKHANDS, Namecheap, Orchestrate, Screenhero, SendGrid, stripe, Travis CI, Unreal Engine
JetBrains products free for students
JetBrains is now offering their products for free for all students. By using your student email or your ISIC/ITIC membership you can now get a free license for all products for one whole year.
In case you are not familiar with JetBrains (?!) you can find their main products listed below, some of which you should know.
ReSharper
ReSharper extends Visual Studio with over 1700 code inspections for C#, VB.NET, ASP.NET, JavaScript, TypeScript and other technologies. For most inspections, ReSharper provides quick-fixes (light bulbs) to improve code in one way or another.
IntelliJ IDEA
IntelliJ IDEA is a Java IDE for developing computer software.
PhpStorm
PhpStorm’s smart code editor provides excellent support for PHP (including the latest language versions and frameworks), HTML, JavaScript, CSS, Sass, Less, CoffeeScript, and many other languages. Enjoy coding with intelligent context-aware code completion, error detection, and on-the-fly code inspections & fixes.
dotTrace
dotTrace offers several profiling modes to help you detect any performance bottlenecks in a variety of .NET applications. Use dotTrace Home screen to choose your profiling targets, access recent profiling sessions or configure profiling options.
RubyMine
RubyMine’s smart code editor provides first-class support for Ruby and Rails, JavaScript and CoffeeScript, ERB and HAML, CSS, Sass and Less, and more. Take advantage of language specific-aware code completion, error detection and on-the-fly code fixes.
WebStorm
WebStorm’s smart code editor provides first-class support for JavaScript, Node.js, HTML and CSS, as well as their modern successors.
Take advantage of code completion, error detection, refactoring and more!
dotCover
JetBrains dotCover is a .NET unit test runner and code coverage tool that integrates with Visual Studio.
Enable WordPress Permalinks On IIS
By default IIS will throw an error (usually a not found error, 404) when WordPress is using permalinks.
The reason of that is because IIS is trying to map the URL you are giving it to a file on the system, which obviously does not exist. Luckily there is a simple fix to this problem.
The logic behind this solution is simple. Check if the URL provided is pointing to a file or directory on the system. If not, rewrite the action to index.php which will allow WordPress to handle it.
In order to enable WordPress permalinks on IIS add the following rewrite rule in your web.config where your WordPress is located.
1 2 3 4 5 6 7 8 9 10 11 12 | <rewrite> <rules> <rule name="Main Rule" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php" /> </rule> </rules> </rewrite> |
Posted in Software Tips.