Skip to content

Instantly share code, notes, and snippets.

@crnastena
crnastena / reset_bluetooth.sh
Created April 18, 2019 05:57
MacOs script to reset bluetooth, when devices cannot connect. Without rebooting. Depends on brew blueutil.
# first install blueutil using homebrew e.g.
# brew install blueutil
echo reset bluetooth script.
blueutil -p 0
echo turned off bluetooth.
# name of wi-fi device is en0 in my instance, you can change it as needed.
networksetup -setairportpower en0 off
@crnastena
crnastena / 1-vs-build-ouptut.txt
Last active October 5, 2018 12:38
Regex to convert Visual Studio build suggestions "Consider app.config remapping of assembly" to dependentAssembly configuration records in order to "to solve conflict and get rid of warning"
56> Consider app.config remapping of assembly "System.Runtime.InteropServices.RuntimeInformation, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "0.0.0.0" [] to Version "4.0.2.0" [C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net462\lib\System.Runtime.InteropServices.RuntimeInformation.dll] to solve conflict and get rid of warning.
56> Consider app.config remapping of assembly "System.Collections.Concurrent, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.10.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\Facades\System.Collections.Concurrent.dll] to Version "4.0.11.0" [C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Collections.Concurrent.dll] to solve conflict and get rid of warning.
56> Consider app.config remapping of assembly "System.Collections, Culture=neutral, PublicKeyToke
@crnastena
crnastena / Log4NetTextWriter.cs
Created August 16, 2018 10:11
When using RedisSessionStateProvider and/or RedisOutputCacheProvider, and want to specify loggingClassName and loggingMethodName to write to log4Net.
using System;
using System.IO;
using System.Text;
using log4net;
namespace RedisUtil
{
public class Log4NetTextWriter : TextWriter
{
private static readonly ILog Log = LogManager.GetLogger(typeof(Log4NetTextWriter));
@crnastena
crnastena / httpd.ini
Created October 20, 2013 04:17
When you are trying to run WordPress on shared hosting Windows 2003, IIS 6 server, you might run into and issue with custom permalinks where custom permalinks might not work, such as /%postname%/ would return 404. If your ISP has ISAPI_Rewrite 2 installed, this might work for you. I've shorted httpd.ini to show just one example but this should w…
[ISAPI_Rewrite]
### subdomain redirect v2 ###
RewriteCond Host: (?:.+\.)?your-domain-name\.com
RewriteCond URL ^/site-path/(.*)
RewriteCond METHOD GET
RewriteRule ^/site-path/(.*) /$1 [I,R]
RewriteCond Host: (?:.+\.)?your-domain-name\.com
RewriteCond METHOD POST
RewriteRule ^/site-path/(.*) /$1 [I]
@crnastena
crnastena / roomservice.xml
Created October 16, 2013 19:54
Sample QuincyATT local manifests roomservice.xml for CM10.2
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_samsung_msm8660-common" path="device/samsung/msm8660-common" remote="github" revision="cm-10.2" />
<project name="CyanogenMod/android_device_samsung_quincyatt" path="device/samsung/quincyatt" remote="github" revision="cm-10.2" />
<project name="CyanogenMod/android_device_samsung_qcom-common" path="device/samsung/qcom-common" remote="github" revision="cm-10.2" />
<project name="CyanogenMod/android_device_samsung_quincy-common" path="device/samsung/quincy-common" remote="github" revision="cm-10.2" />
<project name="CyanogenMod/android_kernel_samsung_msm8660-common" path="kernel/samsung/msm8660-common" remote="github" revision="cm-10.2" />
<project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" remote="github" revision="cm-10.2" />
</manifest>