kali linux – Can we create a virtual wireless interface on a Wifi router (not USB/inbuilt adapter) for pentesting

Wireless Newb query.

am aware that we can use either internal/external wireless adapter for enabling inject/monitor mode.

But are there any Wireless Modes/AP/Router which have this functionality.
something which will enable us to connect o its wireless SSID but also allow us to create another wlan interface for monitor / inject mode on the router/ap itself.
(to be clear am not talking about the usb adapters which we connect to laptop, but wireless outer which acts as AP and connects multiple devices something like D-Link DIR-615 Wireless-N300)

libraries – How C++ library with interface works

In my project a third part c++ library is used. Header file for the library is included. I am trying to understand how it is working in my project. The header file is a interface which has all the pure virtual functions. An autopinter is created for Interface and using pointer functions of the Interface are being called and it is working.
I thought implementation for the functions in interface will be in library. So to confirm that I commented including library and built it. I didn’t find any error. Now I am confused. How is it working?

How do people create c++ libs with interfaces. With interface, how can we call functions in lib without implementing interface?

My question sounds like basic, but this question is bugging me.
Sometimes understanding how it is working is more interesting.

Is there a statically typed programming language that implements Polymorphism without using a superclass or an interface?

Is there a statically typed programming language that implements Polymorphism without using a superclass or an interface (if such implementation is even possible)?

bluetooth – Assistive device for the motor-impaired: how to interface with iPad’s Assistive Touch from code

I have an assistive device for people who can’t touch a screen, that decodes commands (like move left/right, click) and broadcasts them as UDP packets. On most platforms, say Windows or Android, I have a Python script running that receives these commands and controls the mouse on that platform.

I would love to achieve this on iOS, particularly an iPad.

iOS has “Assistive Touch” which can display a pointer on the screen, and be controlled by an external Bluetooth device, which is a great start. One solution I’m imagining is connecting the iPad to a Bluetooth device like a mouse or keyboard to control the Assistive Touch pointer, and controlling that Bluetooth mouse or keyboard using code.

( Stream of UDP commands ) ===> ( Bluetooth device ) ===> Assistive Touch on iPad

Is there any such Bluetooth device that can connect to an iPad and can be controlled using code, so I can control the iPad based on the stream of commands mentioned above?

Or any method of telling the iPad these commands, the way a Bluetooth mouse can?

(I’ve heard that writing a script to act as the Bluetooth device itself is a huge undertaking, and not the path one should go down if they’re not already well-versed in that domain. But if there is in fact a way to do that, I am open to anything.)

macos – How to stop VLC showing video separate from control interface?

I’m on macOS 10.14.6 and VLC 3.0.11. A while ago, VLC started showing my videos in a separate borderless window, like this:

separate windows!

I cannot figure out for the life of me how to configure this so I get the traditional view back, where the control panel is part of the window showing the video. How can I fix this?

Refactor Typescript interface – Code Review Stack Exchange

I have an object with three possible properties:

consistencySelector = {
  transaction: "kkjk4k45kjlkf";
  newTransaction: {};
  readTime: "sometime";
}

I would like only one property to be present at any time using the following definitions:

interface Transaction {
  transaction: string;
  newTransaction: never;
  readTime: never;
}

interface NewTransaction {
  newTransaction: object;
  readTime?: never;
  transaction?: never;
}

interface ReadTime {
  readTime: string;
  transaction?: never;
  newTransaction?: never;
}



type consistencySelector = Transaction | NewTransaction | ReadTime;

Must I make optional never properties for every branch or is there a more elegant way to achieve the same result? for instance if consistencySelector had 20 properties

java – Is this an anti pattern or misusing the interface default method?

Instead of checking the null and throwing exception each time we call findByOrderNumber method, I came up with this pattern by taking advantage of a default method, are there any patterns misused here or is it considered as misusing the default methods?

@Repository
public interface OrderRepository extends JpaRepository<Order, UUID> {

  
    Optional<Order> findByOrderNumber(@NotBlank String orderNumber);

    default Order findByOrderNumber_NullSafe(@NotBlank String orderNumber) throws ApiCustomErrorsException {
        return findByOrderNumber(orderNumber)
                .orElseThrow(()-> new ApiCustomErrorsException("Order not found"));
    }
}

microservices – What is a not well-defined interface?

Any interface definition that isn’t specific enough to determine whether a client or service implementation conforms to it is not well-defined. Some examples:

  • unspecified character encoding (one side using utf-8 while the other uses iso8859-1)
  • unspecified number representation (decimal point versus comma)
  • implicit sequencing requirements (need to call createFooList before you can call addFoo)
  • incomplete specification of limits, constraints, semantic rules etc.

In general, if developers argue about the correct usage or implementation of an interface it’s a good indicator that the interface is ill-defined (or that the developers didn’t understand it, which also happens.)

Just being awkward or difficult to use doesn’t make an interface ill-defined, though.

java – Break down one public interface to different classes, but where to put the behaviour?

(i’m not sure if thats a good title here (because its a very abstract topic), feel free to change it, if you have a better one)

I have a thing (i dont want to call it controller, so thing)
So this thing you can send the following messages:

1 solution

t=new thing();
t.trySet("knob 1", true);
t.trySet ("knob n", false);
t.getStateFrom("knob 5");
t.setAllKnobsTo(true)//maybe the thing decide only set the minimum possible knobs to true

As you can see here, the try could mean that the setting fails. The thing also can do there some more, maybe if it set knob 1 to true, it decide also to set knob 5 and 7 to true.

However, i think its not a good design, to write the knobs as string.

So i would refactor it to the following:

2 solution

t.getKnob1 //if hardcoded or
t.getKnob(1)//if not hardcoded and i want to change the number on the fly
-> t.getKnob(1).set(true/false);

So in that case i have the same functionality but not only the thing class, but more classes, classes for the knobs. But they are all anemic. so only data-classes, and having only a delegate-functionality to the parent, to thing, because only the thing can decide if the knob can be set to true or not. Its a anemic model here, i think. Maybe i also want to have some sub-knobs to the knob, and maybe a “light” to the knobs. But all is controlled by the thing, because the knob-self cant decide that, if he is able to be set to true or not, also the logic if the light should be set on or not is in the thing.

There is one more problem: I have a cyclic dependency between the knob and the thing. Cause the thing want to set the state of the knob and the knob “must can” message the thing about the state-change-wish, the user makes directly to the knob.

Is that a good design?, If not (cyclic, anemic says it’s not), what i can do there better?

Maybe i also want to add there some observer. So a gui-element which presents one knob have a direct listener on the particular knob. Thats ok i think. But on the other side i want to have a network-listener, cause i want to send each change in the thing over the network, then i think, having from the network listener on each knobs isn’t a good idea, in that case i would only have one listener on the thing, which streams all interessting informations about changes.

But how would you do this?

The gui-knob-listener could also became a problem. If i want to throw thing away and want to install a new one, i have to unregister all listener on the knobs, and install listener on the new knobs (error-prune i guess?). So in that case i think it would also be easier if i dont work with the knobs directly but with some thing acting as a facade like in solution (1).

I modeled similar a few years ago. The thing was a mixing-station. The knobs the parts on the mixer: slider, knobs, toggler, and so on. These are arranged in channel. But anyway if i put the logic into the knobs direclty, they must have access to each other one, to check if it is allowed to change the value. There were some user-retriction and some special slider (grouped-fader).

So an example: If a user changes one slider, the other one have to follow in some way (not always the same way). Manually i am allowed to change a slider from range 20-80, but if the controller decide, he can automatically change one slider to 110.

So how you would model that in a OO-way?.

It seems, that the object gets anemic, i get cyclic stuff in there, but i need a controll-unit, which do the decisions and the state-changes in the anemic objects.
Maybe i can model some logic into the anemic-objects (into the knobs, the slider, and so on), but anyway, i cant only work with the state in the anemic-object. I need more state, i need the state from other knobs. Also if i can set one knob to true, maybe there i must also set some other knobs to true. So here i don’t have any encapsulation anymore. So isnt it better to have that kind of logic not in the knob, but on a controller (a thing?)

  • But is that still OO?
  • How you would model that?
  • Where you would put the logic? Into the knobs, into the controller, somewhere else?
  • Is that ok expose the knobs in the sense of “public-interface”. So i dont hide the knobs in the controller. I expose that, because i see the knobs as part of thing's public interface. Is that then ok? When you would hide that?
  • Would you really…/or is there any case, where you would… access to the knobs with that string interface like in my solution 1?

object oriented – What does “common interface” mean in OOP?

I have seen the term “common interface” used a lot while reading books about OOP.

For example, the book The Essence of Object-Oriented Programming with Java and UML says the following:

Abstract classes usually define a common interface for subclasses by
specifying methods that all subclasses must override and define


My understanding of the term “common interface” is the following:

Assume that we have a superclass (or an interface or an abstract class) called Animal and two subclasses called Dog and Cat, and Animal have two virtual methods called makeSound() and move().

Now the common interface would be composed of two methods which are Animal.makeSound() and Animal.move().

Assume that we have the following code:

Animal animal1 = new Dog();
animal1.makeSound();
animal1.move();

animal1 = new Cat();
animal1.makeSound();
animal1.move();

The explanation of the above code is the following:

Animal animal1 = new Dog() creates an Animal common interface and associate a Dog object with it:

enter image description here

animal1.makeSound() sends an Animal.makeSound() message to the common interface, and then the common interface sends a Dog.makeSound() message to the Dog object:

enter image description here

Same thing happens in the case of animal1.move() (which is the Animal.move() message is sent to the common interface, etc.).

animal1 = new Cat() removes the Dog object from the common interface, and associate a Cat object with the common interface:

enter image description here

animal1.makeSound() sends an Animal.makeSound() message to the common interface, and then the common interface sends a Cat.makeSound() message to the Cat object:

enter image description here

Same thing happens in the case of animal1.move() (which is the Animal.move() message is sent to the common interface, etc.).

Am I correct in my understanding?