Tuesday, July 23, 2019

networking - monitoring and blocking network traffic




Which is the best program for monitoring and blocking network traffic through Local network from computer, which is connected to that network?

macros - Excel sort dates to be in oldest to newest without changing grouping

I have a list of customers with due dates and corresponding payment dates but the payment dates weren't updated in the correct order. Is there a way I can sort the payment date to be in order without changing the order of the customer and their original due dates? Either thru a look up that can get the dates in order or thru a macro. I've tried using a large on index match but was unsuccessful. Any help would be great!



Data set looks like this



CUSTOMER, DUE DATE, PAYMENT DATE

Toni, 1-Jan 17, 17-Mar-17

Toni, 16-Jan 17, 2-Mar-17
Toni, 31-Jan-17, 1-Jan-17
Toni, 15-Feb-17, 1-Apr-17
Rr, 7-Jan-17, 15-Feb-17
Rr, 22-Jan-17, 16-Jan-17
Rr, 6-Feb-17, 31-Jan-17


End result should look like this




CUSTOMER, DUE DATE, PAYMENT DATE
Toni, 1-Jan 17, 1-Jan-17
Toni , 16-Jan 17, 2-Mar-17
Toni , 31-Jan-17, 17-Mar-17
Toni , 15-Feb-17, 1-Apr-17
Rr, 7-Jan-17, 16-Jan-17
Rr, 22-Jan-17, 31-Jan-17
Rr, 6-Feb-17, 15-Feb-17



Apologies in advance for the poor formatting as I'm still new.

Monday, July 22, 2019

keyboard - macOS remap keys as modifiers


I use a keyboard layout called 3l (three layout) which is a layered keyboard layout. Here is the main layer (the behaviour when no modifier keys are pressed):


normal 3l layout


Now, when I am holding down the ' on a normal keyboard (sym in 3l), I am in "symbols" mode and the rest of the keyboard behaves differently. Here's a picture of this mode:


symbols layer of 3l


Effectively, this symbols key is like a special Shift which allows me to access special characters.


Additionally, I have a numbers layer which has the same effect as the symbols layer and is activated by the / key, but has cursor and number-pad controls instead:


enter image description here




The person I forked my layout from already got the layout working in Linux and Windows (using AutoHotKey). I am trying to port it to macOS as well. So far I have created a 3l.keylayout file (see it here) and have very basic functionality working.


What's Working



  1. The keys in normal mode work fine.

  2. If I press the symbol modifier key, the first character I press is outputted as the correct symbol. For example, if I press the symbol key and then O, / is outputted.

  3. The same goes for the cur/num key for the numberpad output.


What's not Working



  1. If I press and hold the symbol modifier key, and type multiple characters, only the first one actually outputs the symbol. (Same goes for the cur/num key as well.)

  2. If I press and release one of the modifier keys and then press another key, the symbol/number is outputted. This should not be the case. When I release the modifier key, I want it to go back to normal mode (just like the Shift key).

  3. The cursor manipulation keys do not work reliably in all applications and they also have the issue of not allowing repeated keys when they do work.


Is there any way for me to get the functionality I described above in macOS (Sierra and later)?


Note: I have also tried to remap ' and / to Right Option and Right Control using Karabiner Elements and then attempted to create a new keymap in 3l.keylayout that is activated by those keys. This did not work, however. It screwed everything up and I got into a perpetual control/option key situation.


Answer



I was able to fix this issue using Karabiner-Elements' complex modifications.


Here is my complete karabiner.json file.


Under profiles -> rules -> manipulators, I added two manipulators. One for sym and one for cur.


I copied the sym manipulator below:


{
"conditions": [
"name": "sym",
"type": "variable_if",
"value": 0
},
{
"name": "cur",
"type": "variable_if",
"value": 0
}
],
"from": {
"key_code": "quote",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "sym",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "sym",
"value": 0
}
}
],
"type": "basic"
}

Then I went through every key setting, i.e. when the key is pressed with no modifier, the sym modifier, and the cur modifier.


This works flawlessly.


Reducing size of Windows 7 system restore ISO image

As I have a Dell laptop, it appears I cannot use the Windows 7 ISO images that Microsoft provide for download, as they won't recognize the product key printed on the machine. Instead, Dell provide a download of their recovery disc image, but it is somewhat larger than the bare Windows ISO images and will not fit onto any media I have here. Is there any way of removing unnecessary parts of the file so that I can install it onto a 4GB SD card to restore my system when I change out my hard disk?

Disable Windows 10 Update Notification OSD

Every now and then in Windows 10 it keeps grabbing my screen with an OSD telling me about updates with a button that takes me to the update menu in Settings. It's very annoying at times, especially whenever I have an app in full-screen it takes me away from it just to tell me about updates.


I want to disable this screen grabbing OSD notification because it's too obtrusive and simply outright annoying. Would prefer if I can just have it notify me in small popup balloon notification instead so it can be viewed in Message Centre.


I'm fine with some registry tweaks or whatever, either that or just disable update notifications completely. I currently only have it to notify of updates, but not download and install them whenever it chooses.

windows 10 - My computer keeps waking from sleep without any obvious reason

I have decided to create a new thread after having perused a dozen or more discussions on similar topics, that is, related to the sleep feature, without finding the right answer.




In a nutshell this is what is happening: About a month ago, my computer has started to wake from sleep without any obvious reason. In the event viewer these awakenings can be followed under the Power-Troubleshooter event in the Windows logs. Invariably the source is marked as unknown.



I tried to get more information using the lastwake command prompt, but to no avail at all, the answer it gives equals to unknown.



The time of these awakenings is very different, it is not a fixed hour or minute of the day. For example: 04:08:25, 12:37:06, 04:18:35, 02:27:25, 12:05:40, 02:03:44, 12:43:54, 12:13:32 etc. Usually a couple of hours pass between the events, but there are days, when it wakes almost hourly. Example screenshot:



Event viewer



I have already gone through all the possible settings that could be responsible of this problem, but it is still there. As a makeshift solution, I have adjusted two minutes for the computer to go to sleep if no mouse or keyboard event. I had in addition to recur to a small program that lets me quickly enable or disable the sleep feature with a single click from the tray, similar to Caffeine but better, more flexible (DontSleep).




It all works fine now, the annoyance is considerably reduced, but still I haven’t got the slightest idea as to the wake source. Could it be a virus that wakes the computer in my absence in order to break into the system and get my bank details or something of the sort? Any hint would be appreciated.






Sorry for the humorous title. I just wanted it to be unique. There must be in this forum already quite a lot of posts with “sleep” for keyword.



As to the lastwake prompt, it doesn’t give any useful information not to be found in the Event Viewer. It looks like this:



Wake history count: -1

Wake History: [0]
Wake Source Count: -0



Now, I believe that the zero in this context means just the same as the “Source Unknown” of the Event Viewer. But enlighten me if I am wrong.



To disable the Wake Timers was one of the first things I did. I have just checked it again, they are still disabled.



The latest development is that my computer now seems to have permanently adopted this new regime to wake hourly, sometimes even only 40 minutes after the last wake. I am completely puzzled. At the beginning it woke about 3-4 times in 24 hours. Now it is closer to 30, the count of unexplained wake events in a day. (This is an estimate since obviously I can’t tell for the afternoon and the evening hours when I am using my computer). So, if I had one question at the outset, now I have two of them: 1) What is the wake source? 2) What causes the changes in the wake frequency?



As to your request to specify all the steps I have taken so far to solve this problem, I am afraid I couldn’t enumerate them all. I am not really what you call a computer geek, I don’t tinker about with command prompts and registry edits on a daily basis, I do such things only when really in a bad fix. What I intend to do is to arrive at the solution by ruling out all the possible sources one by one. So, your first suggestion was Wake Timers:




1) Wake Timers: disabled.



I hope, before we reach number 10, the culprit will be pinpointed. I am awaiting suggestion nÂș2.






Well, I am afraid this thread has become pretty inactive. Anyway, I will post the latest developments in connection with my problem, someone might still react. So, my second question had a simple answer: It was a Windows update that woke the computer hourly. The reason I didn’t get it immediately is just that before, when it happened less frequently, I checked the updates and there was none. So, I have updated Windows now, and as a result the computer wakes up only as it did before the update, that is, 3-4 times a day. Then, as suggested on another site, I disabled one more potential wake source, namely the WOL (wake on LAN):



Device manager > Network adapters > Atheros network adapter > Properties > Advanced > Wake on magic packet: Disabled




This didn’t help either. I am not sure if I am supposed to restart the computer after this change. I didn’t do it yet, but normally the changes made via the control panel take effect immediately. But maybe I am wrong there. Anyway, in order to rule out all network-related wake sources, I got the idea to switch off my router overnight. Well, it didn’t help, the computer woke anyway during the night. So, to summarize, so far I have ruled out two potential wake sources:



1) Wake timers



2) Wake on LAN plus all wake sources to be found on a network, either local or external



P.S. Should I post new information as a reply to the tread or as a comment if I want to address all the participants?

linux - Can CygWin 64 bits compile 32 bits sources?


I am trying to compile on CygWin 64 bits the (presumed) 32 bits wake on lan tool here created by Thomas Krennwallner, supposed to compile on Unix and Windows under CygWin.


After download I did:


tar -zxvf wol-0.7.1.tar.gz

and, in order to update its configure.guess script (the included one is a bit old: from 2004), I have downloaded it from here.


So, according to its README file, I do:


./configure

and I get:


Luis@Windu /cygdrive/h/Temporal/wol/wol-0.7.1
$ ./configure
checking build system type... x86_64-unknown-cygwin
checking host system type... x86_64-unknown-cygwin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.

This is my config.log:


This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = Windu
uname -m = x86_64
uname -r = 1.7.33-2(0.280/5/3)
uname -s = CYGWIN_NT-6.1
uname -v = 2014-11-13 15:47
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = x86_64
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /cygdrive/c/Program Files (x86)/AMD APP/bin/x86_64
PATH: /cygdrive/c/Program Files (x86)/AMD APP/bin/x86
PATH: /cygdrive/c/Windows/system32
PATH: /cygdrive/c/Windows
PATH: /cygdrive/c/Windows/System32/Wbem
PATH: /cygdrive/c/Windows/System32/WindowsPowerShell/v1.0
PATH: /cygdrive/c/ATI Technologies - Graphics/ATI.ACE/Core-Static
PATH: /cygdrive/d/Utilidades/UnxUtils
PATH: /cygdrive/d/Utilidades/CURL
PATH: /cygdrive/d/Utilidades/SSH-Rsync/cwRsync/bin
PATH: /cygdrive/d/Utilidades/Copy Path To Clipboard
PATH: /cygdrive/d/Programas/HashCat/OCLHashCat
PATH: /cygdrive/d/Utilidades/Scripts
PATH: /cygdrive/d/Utilidades/SysInternals Suite - PSTools
PATH: /cygdrive/d/Utilidades/NirSoft NirCmd
PATH: /cygdrive/c/nmap
PATH: /cygdrive/c/Bitvise SSH Client
PATH: /cygdrive/d/Utilidades/Scripts/Clortho
PATH: /cygdrive/c/Nmap
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1348: checking build system type
configure:1366: result: x86_64-unknown-cygwin
configure:1374: checking host system type
configure:1388: result: x86_64-unknown-cygwin
configure:1428: checking for a BSD-compatible install
configure:1483: result: /usr/bin/install -c
configure:1494: checking whether build environment is sane
configure:1537: result: yes
configure:1570: checking for gawk
configure:1586: found /usr/bin/gawk
configure:1596: result: gawk
configure:1606: checking whether make sets $(MAKE)
configure:1626: result: yes
configure:1810: checking for style of include used by make
configure:1838: result: GNU
configure:1909: checking for gcc
configure:1925: found /usr/bin/gcc
configure:1935: result: gcc
configure:2179: checking for C compiler version
configure:2182: gcc --version &5
gcc (GCC) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2185: $? = 0
configure:2187: gcc -v &5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/gcc_old/gcc-4.8.3-5.x86_64/src/gcc-4.8.3/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc_old/gcc-4.8.3-5.x86_64/src/gcc-4.8.3 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --libdir=/usr/lib --datarootdir=/usr/share --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C --build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_atexit --with-dwarf2 --with-tune=generic --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --disable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --enable-libada --enable-libgcj-sublibs --disable-java-awt --disable-symvers --with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id
Thread model: posix
gcc version 4.8.3 (GCC)
configure:2190: $? = 0
configure:2192: gcc -V &5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2195: $? = 1
configure:2218: checking for C compiler default output file name
configure:2221: gcc conftest.c >&5
/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/../../../../x86_64-pc-cygwin/bin/ld: cannot find crt0.o: No such file or directory
/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lcygwin
collect2: error: ld returned 1 exit status
configure:2224: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "wol"
| #define VERSION "0.7.1"
| #define PACKAGE "wol"
| #define VERSION "0.7.1"
| #define _GNU_SOURCE 1
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2263: error: C compiler cannot create executables
See `config.log' for more details.
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=x86_64-unknown-cygwin
ac_cv_build_alias=x86_64-unknown-cygwin
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-unknown-cygwin
ac_cv_host_alias=x86_64-unknown-cygwin
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
ACLOCAL='${SHELL} /cygdrive/h/Temporal/wol/wol-0.7.1/missing --run aclocal-1.7'
ALLOCA=''
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='${SHELL} /cygdrive/h/Temporal/wol/wol-0.7.1/missing --run tar'
AUTOCONF='${SHELL} /cygdrive/h/Temporal/wol/wol-0.7.1/missing --run autoconf'
AUTOHEADER='${SHELL} /cygdrive/h/Temporal/wol/wol-0.7.1/missing --run autoheader'
AUTOMAKE='${SHELL} /cygdrive/h/Temporal/wol/wol-0.7.1/missing --run automake-1.7'
AWK='gawk'
BUILD_INCLUDED_LIBINTL=''
CATOBJEXT=''
CC='gcc'
CCDEPMODE=''
CFLAGS=''
CPP=''
CPPFLAGS=''
CYGPATH_W='cygpath -w'
DATADIRNAME=''
DEFS=''
DEPDIR='.deps'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
EXTRA_LIBS=''
GENCAT=''
GLIBC21=''
GMSGFMT=''
HAVE_ASPRINTF=''
HAVE_POSIX_PRINTF=''
HAVE_SNPRINTF=''
HAVE_WPRINTF=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
INSTOBJEXT=''
INTLBISON=''
INTLLIBS=''
INTLOBJS=''
INTL_LIBTOOL_SUFFIX_PREFIX=''
LDFLAGS=''
LIBICONV=''
LIBINTL=''
LIBOBJS=''
LIBS=''
LN_S=''
LTLIBICONV=''
LTLIBINTL=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /cygdrive/h/Temporal/wol/wol-0.7.1/missing --run makeinfo'
MKINSTALLDIRS=''
MSGFMT=''
MSGMERGE=''
OBJEXT=''
P2M=''
PACKAGE='wol'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PERL=''
POD2TEXI_FALSE=''
POD2TEXI_TRUE=''
POSUB=''
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
USE_INCLUDED_LIBINTL=''
USE_NLS=''
VERSION='0.7.1'
XGETTEXT=''
ac_ct_CC='gcc'
ac_ct_RANLIB=''
ac_ct_STRIP=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include='include'
am__leading_dot='.'
am__quote=''
bindir='${exec_prefix}/bin'
build='x86_64-unknown-cygwin'
build_alias=''
build_cpu='x86_64'
build_os='cygwin'
build_vendor='unknown'
datadir='${prefix}/share'
exec_prefix='NONE'
host='x86_64-unknown-cygwin'
host_alias=''
host_cpu='x86_64'
host_os='cygwin'
host_vendor='unknown'
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/cygdrive/h/Temporal/wol/wol-0.7.1/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define PACKAGE "wol"
#define PACKAGE "wol"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define VERSION "0.7.1"
#define VERSION "0.7.1"
#define _GNU_SOURCE 1
configure: exit 77

That seems to be reporting the expected problem when compiling a 32 bits program on a 64 bits platform.


Is it possible to solve this?
I have read some info about using the flag "-m32" on the gcc compiler, or sending some variables (exporting) before the compiling, but the problem seems to come rather from the configuring part, not the compiling. The order seems to be:



  • .configure

  • make

  • make check

  • make install

  • make clean


and the first step fails :-( .
Anyway, I tried:


export CFLAGS='-m32' export CXXFLAGS='-m32' export LDFLAGS='-m32'

But the ./configure script keeps failing.


And, by the way, I tried to ignore the error and continue (2nd step) compiling:


make

but it yields some error message reporting (sorry, my CygWin seems to be in spanish) something like No objective specified and no makefile found.


I think that solving this problem could help me to learn a way to compile 32 bits programs on CygWin 64.
I request some help, please.


P.S: I know this tool has a Win32 version available to download, as well as there are another programs for wake on LAN. But where is the learning on that way to solve things?


EDIT: I have installed the following package names on CygWin:


gcc-core
gdb
make
mingw-gcc-core
mingw-gcc-g++
mingw-w32api

EDIT-2: I have saved my day by uninstalling CygWin 64 bits and installing 32 bits version. This everything went smooth and fine.


Answer



Cygwin packages come in two versions, a 64-bit version and a 32-bit version. As the 64-bit library is newer than the 32-bit library, there are some missing libraries and programs.


You can have BOTH the 32-bit and the 64-bit Cygwin installed concurrently without any problems. Thus if you wanted to compile and go on using 32-bit mode, install the 32-bit cygwin and invoke its bash shell.


Cygwin 32-bit is usually installed in c:\cygwin and the 64-bit cygwin is installed in c:\cygwin64.


So in summary, if you need 32-bit capabilities install the 32-bit cygwin and all the necessary packages you need to complete your task.


NOTE: 32-bit programs WILL run on 64-bit windows platforms.


hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...