Posts

Adventures after installing Kali Linux, guide to the Windows immigrate

install kali... on computer, or dual boot, or just vm or Hyper-V... and then.... I'm talking today about Kali 2018.1, some things has changes, they removed " gdebi " and " gsku " which suppose to have some problems, there is instead " apt-get install ", " dpkg ". all those are... with linux you download Packages, source code, or built source code, and install them. so all those programs knows to extract the package and install them, so it doesn't really matter which you use. " pkexec " is supposed to replace " sux " or any of " kdesudo/gksu/gksudo ", but not doing such a good job, so back to the original " sudo ". the point is that when using kali you usually want to use the root user, but for many programs like chrome you prefer to use another user to protect yourself, so they are wrappers to the " sudo " command for graphical programs, so eventually using " sudo " wil...

Dual Boot Kali Linux v2018.1 With Windows 10

Image
How To Dual Boot Kali Linux v2018.1 With Windows 10... well, theoretically that should be super simple if you have a new installation of WIN10 and no anti-virus ect. This link here will provide you all you need, except its preferred for rufus  to make DD Image . btw - rebooting with usb instant reboot UEFI cmd " shutdown /r /fw /t 0 " if fails to load CD-ROM... superuser But while trying to shrink my 0.5TB hard drive to 250GB-250GB, i kept getting this error message There is not enough space available on the disk(s) to complete this operation. Simple answer is that all kind of services are having all kind of clusters around the hard drive that are security locked and you can't touch them. There is the final simple solution, that might work, and then the long one... Most likely that if you turn off some security features as explained here in super user  and even the extras in this link  you will be able to then go to the next step. N...

Install CasperJs on Windows 10

download http://phantomjs.org/download.html windows version npm install -g casperjs copy the folders ... C:\Users\admin\AppData\Roaming\npm\casperjs -> C:\Users\admin\AppData\Roaming\npm\node_modules\casperjs\bin\casperjs add a new system variable : control panel -> system -> advanced system settings -> advanced tab -> Enviorment Variables -> click on Path -> edit -> new ... for phantomjs -> the folder where you extraced the phantomjs rar, its bin folder (where phantomjs.exe is) for casperjs -> the folder copied with the bin folder (where casperjs.exe is) AFTER adding the system variables open cmd and test all ok (enter phantomjs, CTRL+C, enter casperjs, CTRL+C)

linux update error apt-listchanges : Depends: python3-debconf but it is not installed

apt-listchanges : Depends:  python3-debconf but it is not installed the python3-debconf  just might not be installed, so .. as stated here sudo apt-get install python3-debconf all that while trying to upgrade my kali with apt-get update -y && apt-get full-upgrade and got many more problems. i switched to       sudo apt-get update -y && apt-get upgrade  -y   sudo apt-get dist-upgrade -y and things were good again if it updates xrdp, if ur on hyper-v, just reconfigure xrdp.ini

Javascript, Prototype oriented programming

this is kind of a follow-up to my  Python vs C#, a REAL answer post , which in the end, breaks programming principles and how languages (mainly C# and Python) implemented them. But then there is this strange language, Javascript (js), which is both compiled and dynamic, and mainly, imperative, and, unlike the rest, prototype oriented. whats the connection and what that means? Imperative vs. Declerative lets go back to that for a sec. I am writing a program, with the object Person, with name, last name, age, address, all the usual. it runs, i sell it. after a few days, the boss comes and says the client now wants v2, with dogs... if its a declarative language, like C#, i must declare a Dog class somewhere and declare a connection to Person, whether its by giving it a PersonId or just setting it as a property of person. If it was Python, which has Imperative features, i could just add for a person instance a property of a simple type, like DogId. but for a Dog class i als...

Angular run multiple apps in 1 project, Optionality bootstrap components

most posts you'll find talk about actually managing 2 totally different apps under 1 project, and that's best described here:  https://yakovfain.com/2017/04/06/angular-cli-multiple-apps-in-the-same-project/  . but what i really want to achieve is behavior more close to angular 1.x where you could write like 50 directives / components and put just set the ng-app attribute in your Aspx master page and it would just catch whatever is in, so in each page there were 2-10 directives and all was good. with the angular-cli today its not native possible, but kouasda  found a solution, where you test the page for the your angular tags and bootstrap them accordingly, as told in this issue  and shown in this plnk . eventually your app.module should look like this import {BrowserModule, DOCUMENT} from '@angular/platform-browser' import {NgModule, Inject, ApplicationRef} from '@angular/core' import {AppRootOne} from './app-root-one.component' import ...

c# WebRequest error An existing connection was forcibly closed by the remote host

“An error occurred while making the HTTP request to https://<API endpoint>. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.”  Inner exception was “ Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ” this happened to me when doing some HttpWebRequests and suddenly everything stopped working. apparently the server changed protocol to Tls1.2, and that caused all the mess. PLUS i was using .Net4 so no enum there, so here is the magic line for all you problems   ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;

Sharepoint Rest Api

Working with the SP Rest Api i found some basics that are here to remember. get by title var u = "/sites/newportal/_api/Web/lists/getbytitle('Site Pages')/items" select person field u += "?$select=Title,Assigned_x0020_To0/Name,FileRef,FileDirRef" +          "&$expand=Assigned_x0020_To0" get folder var u = "/sites/newportal/_api/Web/GetFolderByServerRelativePath" +               "(decodedurl='/sites/newportal/SitePages/NewEmp')/Files?$select=*" but to really get a person data by folder in site pages i had to use search var u = "/_api/search/query?" +             "querytext='ParentLink:NewEmp'" +             "&selectproperties='Path,Title,AssignedTo0OWSUSER'"

SharePoint Group Display Templates [Grouping]

the questions... How to Group Search Results Using Default Display Templates? Grouping search results with display templates for the CSWP? How to Define a Custom Group Display Template (GroupTemplateId)? and the answer is a sad one... SETTINGS Well, 1st create yourself a Group Display Template file, just take the default "group_xxx.html" from the "Search" or "Content Search" Folders, whatever you are using. After adding it to the Master Pages, you can't add it via JS, you MUST download a copy or you Search WebPart (export) and change the value in "GroupTemplateId" to your group JS file. Now at least you have a CSWP with you own group.html/js file. So I've never really payed attention but in our Controls Display Templates the rendering part is in  _#= ctx.RenderGroups(ctx) =#_ , GROUPS, not items. This actually ALWAYS going through a group rendering function, and hey, i want to use it. but how? nothing... NOTHIN...

SharePoint display templates ERROR: hexadecimal value 0x3C, is an invalid attribute character

its an error about a "<" or ">". you might have user "Enter" for an element with too many attributes like this <a href="value......."      class="value......."      id="value......."      data-toggle="value......."> collapse it to this <a href="value......."  class="value......."  id="value......."  data-toggle="value.......">

SyntaxError: expected expression, got '&'

SyntaxError: expected expression, got '&' this belongs to the if syntax "a = b ? c : d"; probably the problem is in the 'b'

Adding a Full Task [PlannerTask] to 365 planner

Today i created an angular app to interact with MS 365 Planner. I tried to add a task. The example  @MS - create task works fine { "planId" : "xqQg5FS2LkCp935s-FIFm2QAFkHM" , "bucketId" : "hsOf2dhOJkqyYYZEtdzDe2QAIUCR" , "title" : "Update client list" , "assignments" : { "fbab97d0-4932-4511-b675-204639209557" : { "@odata.type" : "#microsoft.graph.plannerAssignment" , "orderHint" : " !" } }, } Adding a details object was great until i was trying to add some checklist items. My app gave this error [400]: message : " Schema validation has failed. Validation for field 'Title', on entity 'Task' has failed: A non-null value must be specified for this field. " Well, this is the end of the story, since after everything went well in the Graph Explorer my app still gave the same error, until i not...

Angular Dual App

or more exact run separate root components. you can just add multiple components to the  bootstrap: [  decorator. then you can run as many apps as you want. bootstrap: [   AppComponent ,   LoginComponent ,   ContactComponent ,   TableComponent , ] < body >   < app-welcome ></ app-welcome >   < app-login ></ app-login >   < app-table ></ app-table >   < app-contact ></ app-contact > </ body > Services? in Angular 4 Services has scope. if we create a service at the App.Module Scope, it will share all it's info will all apps, all comps, but if you create a service, and declare it inside a  providers: [  decorator, inside a specific Component, then all child components will share the same instance, but siblings comps declaring the same service will have their own instance.

MatDatePicker Errors

if you get this one Can't bind to 'matDatepicker' since it isn't a known property of 'input' then you're missing some modules in your import, the datepicker has many dependencies, and i didn't tried to find them, so just fill in the long long list in the plnk. I advice to just use a different module with all Angular Material modules like in the examples . for this one MatDatepickerToggle.html:1 ERROR TypeError: Cannot read property 'disabled' of undefined you have some miss-spell like  [ for ]= "pickerFrom" vs # pickerFrom

Javascript sort then by

i'll just give a piece of code to show this Great Answer . var a = []; for (x = 1; x <= 3; x++){ for (y = 1; y <= 3; y++){ for (z = 1; z <= 3; z++){ a.push({x:x, y:y, z:z}) } } } a a.sort(function (a, b) {     return a.z - b.z || a.x - b.x || a.y - b.y ; }); just copy paste into the console and see for yourself. for strings you'll need extra help var a = []; for (x = 1; x <= 3; x++){ for (y = 1; y <= 3; y++){ for (z = 1; z <= 3; z++){ a.push({x:x, y:y, z:'af' + z.toString()}) } } } var strSort = function(a,b){ if(a < b) return -1;     if(a > b) return 1;     return 0; } a.sort(function (a, b) { return strSort(a.z,b.z) || a.x - b.x || a.y - b.y ; });

Angular 4 Keyup event fire multipletime?

i'll explain more of what i've learned answering this stackoverflow question . well, lets just start by explaining that if you want say some AutoComplete based on an input element, so the problem with Keyup event is that while user is typing "Angu" you actually get 4 events, 1st with input value as "A", 2nd "An", ect. but you want the part where he did "Angu" ... well, there is the native answer, and the RxJs Implementation for that, and i will just start with the RxJx code for the reference, and then go for my Native Javascript example. as you can see youself in my plnkr , we import the Observable as an object and then adding relevant Observable type and operator. couple or sources to that: some recipes medium.com   from the RxJs site reactivex.io anyways these are the imports import { Observable } from 'rxjs/Observable' import 'rxjs/add/observable/fromEvent'; import 'rxjs/add/operator/auditTime';...