Posts

Handling Raw Html

For sometime now I've been at a point in my research to find the proper way to handle raw html. Sometimes you need your api to push raw html with syntax that can't be edited once its submitted.  Handling all html in a 2D array where the first in just the html tag and the second is a child's value which can also be a html tag. { ["p"]["test"]  This may also be another case to start my project with a headless orchard core project. Using fluid syntax might be the better way to allow an api to take information and using a custom javascript library to convert html to the api? 

Image Enhancement Research

For some of the projects I have in mind this would be a great way to handle poor quality images, for example schematics that have low pixels. From there I would have an easier time convert to svg files but that is a project later down the road. For now this is something I need to keep in mind of. msmsajjadi/EnhanceNet-Code: EnhanceNet: Single Image Super-Resolution Through Automated Texture Synthesis (official repository)

Linux: Managing Security & System Logs

Not a linux novice by any means, so this last year (2019) I had been tracking logs on my server. I'll come back to this article and clean it up but incase I dont these definitely helped me track things until I start using a third party tool. sudo ip6tables -I INPUT -m geoip --src-cc IT,FI,GB,CA,MX,CN,DE,TR,ID,RU,IN,IL,BR -j DROP http://blog.jeshurun.ca/technology/block-countries-ubuntu-iptables-xtables-geoip https://unix.stackexchange.com/questions/92560/list-all-connected-ssh-sessions  cat /var/log/auth.log | grep 'Connection closed' |  tail -n 40 sudo iptables -L  iptables -A INPUT -m state --state INVALID -j DROP Notes http://ipset.netfilter.org/iptables.man.html https://unix.stackexchange.com/questions/345114/how-to-protect-against-port-scanners https://unix.stackexchange.com/questions/318859/how-to-use-watch-command-with-a-piped-chain-of-commands-programs https://daenney.github.io/2017/01/07/geoip-filtering-iptables http://xmodulo.com/block-network-traffic

ReUsed Flexcode ADOC Connection

Back in 2019 I was working for a consulting firm which this came in handle, I dont think I will ever need to go back to an ERP system and specially dont think I will need to work with flexcode again. Still this was something that I found and might help someone else. Public Sub Database_Connection()  Do      If cn1.State = 1 Then Exit Sub      On Error Resume Next      Set cn1 = macForm.ConnInfo.OpenADOConn      On Error GoTo 0  Loop  End Sub

Aspnet Dotnet Notes: Custom Authorization & App_Data

Trying to handle a secure folder  where the files are not pushed to the server at deploy. Like all files in wwwroot they are in source control, these will not. The files I'm storing are so big that moving them is a separate process do outside of my application. https://stackoverflow.com/questions/36775942/how-do-i-serve-static-files-only-to-authorized-users https://github.com/ClintBailiff/MiddlewareDemo/blob/master/Startup.cs get current user   inside an MVC controller: From the  Controller  base class, you can get the  IClaimsPrincipal  from the  User  property System . Security . Claims . ClaimsPrincipal currentUser = this . User ; You can check the claims directly (without a round trip to the database): bool IsAdmin = currentUser . IsInRole ( "Admin" ); var id = _userManager . GetUserId ( User ); // Get user id: Other fields can be fetched from the database's User entity: Get the user manager using dependency injection private

Dynamically sitemap.xml in Aspnet Core

Someday I'd like to complete this project but for now I have very little time so I'll just hold onto these notes. The goal or idea would be for me to create a SEO friendly site but with all my experience with cms or spa applications I'd create it more based on a headless cms. If I get the chance I'd want to work with orchard core on this. Notes https://stackoverflow.com/questions/50311264/how-to-create-dynamically-sitemap-xml-in-net-core-2 https://rehansaeed.com/dynamically-generating-sitemap-xml-for-asp-net-mvc/ https://github.com/uhaciogullari/SimpleMvcSitemap#google-sitemap-extensions

Still a use case for slow-cheetah

With .net 6 out I'm still finding myself maintaining application dependent on .net framework 4.7.2 which isnt too difficult to move them over just time consuming. So as a real quick reminder for myself there's a way to handle debug/local environments. Since most employer's dont know about this cool library or dont see the advantage, over using #DEBUG  in code. Which I really hate handling so instead I install slow-cheetah and using the foling.  xdt:Locator="Match(name)" add this to your App.{env}.config and call it a day with handling your environment! Notes https://www.c-sharpcorner.com/article/transform-config-using-slow-cheetah/ https://marketplace.visualstudio.com/items?itemName=vscps.SlowCheetah-XMLTransforms

Popular posts from this blog

Installing Windows on Acer chromebook 15 cb3-532

Entity Framework: ToListAynsc & WhereAsync

CSharp Cheatsheet