Tuesday, August 24, 2021

Ghidra SMS emulator remote debugger

Trying to do: https://wrongbaud.github.io/posts/ghidra-debugger/ but with SMS
Start with blastem, Ghidra 10+

Tried running in windows via: blastem.exe ROM_FILE.bin -D but I couldn't get ghidra to connect to it. not sure which option to choose.

Trying gdb via ssh.



Blastem's read me says

 Invoke an m68k-elf targeted gdb with
the ELF file. Once inside the gdb session, type:

    target remote | BLASTEM_PATH/blastem ROM_FILE.bin -D

Build 6800 gdb: https://sourceware.org/pipermail/gdb/2011-January/039404.html

I tried using WSL, but I forgot blastem needs guid, and doesn't run in wsl ( haven't figured out the wsl2 gui things).

stephen@Cube-Windows:~/source$ blastem romfile.bin -D

error: XDG_RUNTIME_DIR not set in the environment.
The path /dev/dri/ cannot be opened or is not available
The path /dev/dri/ cannot be opened or is not available
Unable to init SDL: No available video device

Switched to vm

sudo apt insttal gcc
sudo apt install make
sudo apt install blastem
source$ wget http://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.gz
source$ tar -xvzf gdb-10.2.tar.gz
source$ cd gdb-10.2
source/gdb-10.2$ ./configure --host=i686-pc-linux-gnu --target=m68k-elf --prefix=/opt/m68k
...
source/gdb-10.2$ make
...
/bin/bash: i686-pc-linux-gnu-ar: command not found

Installing binutils and GCC as cross-compiler for the Motorolla 68000: https://darkdust.net/writings/megadrive/crosscompiler 

~/source$ wget https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.xz
./configure --prefix=/opt/m68k --target=m68k-coff
make
...
checking for cos in -lm... yes
*** Configuration m68k-unknown-coff is obsolete.
*** Support has been REMOVED.

I think this isn't going to end well, since I think gdb is expecting ELF format, but they don't come that way. Blastem says

To use this, you'll want to configure your Makefile to produce
both an ELF executable and a raw binary.

Giving up for now:

Trying dbgengEngine locally:

with arguments similar to

blastem.exe ROM_FILE.bin -D
 But I think that debugs blastem.exe not ROM_FILE.bin

Maybe this isn't what I'm looking for. I think I want Ghidra to connect to a remote GDB stub, like is provided by OpenOCD: https://github.com/openocd-org/openocd/blob/master/src/server/gdb_server.c , maybe that way Ghidra can pretend to be GDB frontend and connect directly to blastem.

Probably something like: https://github.com/Comsecuris/gdbghidra

Monday, May 24, 2021

ffmpeg things

loop reverse

ffmpeg -i c-stab.mp4 -vf reverse c-reverse.mp4
ffmpeg -i c-stab.mp4 -vf tpad=stop_mode=clone:stop_duration=2 c-stab-pad.mp4
ffmpeg -i c-reverse.mp4 -vf tpad=stop_mode=clone:stop_duration=1 c-reverse-pad.mp4
ffmpeg -i c-stab-pad.mp4 -i c-reverse-pad.mp4 -filter_complex "[0:v] [1:v] concat=n=2:v=1 [v]" -map "[v]" c-loop.mp4
ffmpeg -i c-stab-pad.mp4 -i c-reverse.mp4 -filter_complex "[0:v] [1:v] concat=n=2:v=1 [v]" -map "[v]" c-loop2.mp4

burn in subtitles 

ffmpeg -i "input.m4v" -vf subtitles="sub.srt"  output.mp4

nope(missing =) extracted subtitles instead

ffmpeg -i "input.m4v" -vf subtitles "sub.srt"  output.mp4 

MJpeg from mjpeg streamer to youtube

Lousy camera that can't do many fps, camera locks up and needs a dis-connect-reconnect to get it restarted, so limit it to 1 fps, seems to limit it to 2-4fps, but close enough.

mjpg_streamer -i 'input_uvc.so -f 1' -o output_http.so

verify

ffplay "http://192.168.0.155:8080/?action=stream"

OBS capturing the ffplay and sending to youtube would stop every 0.5 - 9 hours.

Laptop that runs the camera can't encode video, the camera says it can h264 it but I didn't trust it since I got mjpeg streamer to work, so run ffmpeg from another computer to do the transcode.

ffmpeg -re -f mjpeg -use_wallclock_as_timestamps 1 -i "http://192.168.0.155:8080/?action=stream" -f lavfi -i anullsrc -vf setpts=PTS-STARTPTS -vsync 0 -c:v libx264 -c:a aac -ar 44100 -ac 2 -f flv "rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx-xxxx"

key thing seem to be -use_wallclock_as_timestamps 1 and -vf setpts=PTS-STARTPTS -vsync 0

C:\Users\Stephen>ffmpeg -re -f mjpeg -use_wallclock_as_timestamps 1 -i "http://192.168.0.155:8080/?action=stream" -f lavfi -i anullsrc -vf setpts=PTS-STARTPTS -vsync 0 -c:v libx264 -c:a aac -ar 44100 -ac 2 -f flv "rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx-xxxx"
ffmpeg version 2020-12-06-git-2aab42bc40-full_build-www.gyan.dev Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      56. 62.100 / 56. 62.100
  libavcodec     58.115.100 / 58.115.100
  libavformat    58. 65.100 / 58. 65.100
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7. 92.100 /  7. 92.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, mjpeg, from 'http://192.168.0.155:8080/?action=stream':
  Duration: N/A, start: 1626537599.499261, bitrate: N/A
    Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 640x480, 25 tbr, 1200k tbn, 25 tbc
Input #1, lavfi, from 'anullsrc':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #1:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_u8 (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 00000232a0f6ce00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000232a0f6ce00] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 00000232a0f6ce00] 264 - core 161 r3027 4121277 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=15 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://a.rtmp.youtube.com/live2/
xxxx-xxxx-xxxx-xxxx-xxxx':
  Metadata:
    encoder         : Lavf58.65.100
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuvj420p(pc, bt470bg/unknown/unknown, progressive), 640x480, q=-1--1, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.115.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
    Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.115.100 aac
[libx264 @ 00000232a0f6ce00] non-strictly-monotonic PTS.00 bitrate=N/A speed=   0x
[mjpeg @ 00000232a0f0f740] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
[libx264 @ 00000232a0f6ce00] non-strictly-monotonic PTS0.02 bitrate=41067.1kbits/s speed=0.00137x
frame= 1192 fps=3.8 q=22.0 size=    8226kB time=00:04:56.19 bitrate= 227.5kbits/s speed=0.948x

SomeTimes this error:


[mjpeg @ 000001f75ef7f740] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
av_interleaved_write_frame(): Unknown errortime=00:32:00.44 bitrate= 229.2kbits/s speed=0.987x
    Last message repeated 1 times
[flv @ 000001f75efe1b80] Failed to update header with correct duration.
[flv @ 000001f75efe1b80] Failed to update header with correct filesize.
Error writing trailer of rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx-xxxx: Error number -10053 occurred

flags to try

-fflags nobuffer and -rtsp_transport tcp

seems to be a bug:
https://trac.ffmpeg.org/ticket/7547

Version 3.4.8-0ubuntu0.2 seems to not have the issue.

 It seems that a "Intel(R) Atom(TM) CPU Z520   @ 1.33GHz" can trancode at about 

frame= 5855 fps=6.4 q=-1.0 Lsize=   11528kB time=00:15:03.96 bitrate= 104.5kbits/s speed=0.995x

So maybe I should have just used that instead.
 

Sunday, May 23, 2021

Ghidra Sega Master System

https://www.smspower.org/Development/MemoryMap says ROM ends at xC000 so Z80 default processor, and select options:

Memory map icon at the top to map ram/ram mirror.

Start at 0xC000, length 0x2000, read/write but probably not execute. Repeat for mirror, start at 0xE000, length 0x2000, (0xFFFC-0xFFFF are special so maybe not those right now I just have labels for them).

Add some IO:

PSG is at 0x007F, VPD Data lines at 0x00BE, VPD Address at 0x00BF, IOPort1 0xDC, IOPort2: 0xDD

Cartridge is likely larger than 0xC000, so add some overlays: Mapper File->Add to program. Select the file again. Options: Overlay✓,Name "Bank#", base Address: 8000, file offset 0x4000 * bankNumber, so for bank 12, 0xC * 0x4000 = 0x30000,

What It should look like after

 

Fixing the JP(some other bank): helpful thing (Search for Reference Manager) keyboard 'r', or right click -> references(bottom of the list) -> add/edit

Bank12 is loaded for Select#2 before jumping to 0x8000.

Other helpful things

Setting a constant to an enum reference is called "Equate" or keyboard 'e'.

All the enums that are 0x3

TODO: do all this automatically with a loader

  1. already started loader
  2. ref1
  3. maybe a better example
  4. more writing
  5. scripts with some more things

Monday, June 22, 2020

Garage Door Screw Drive Fix

Garage door stopped opening. It shut fine, but it kept slipping.
"Martin S80". martin doesn't seem to sell that model anymore. Probably hasn't since 1970.

Google-ing "screw drive carriage assembly"... It looks like a Genie something something. Almost the exact same mold. $18? I don't need the whole thing, just the teeth... "rack" Search google images, That one looks right


Looks ok... hmmm. garagedoorstuff.com? For 8$, I'll risk it.
I probably should have pulled it out to look at it before ordering....

That was a whole lot of 1970's grease there. Phew looks ok. That was fairly worn down.

Fits...

Defiantly not authorized, but I don't have the owners manual.

All greased back up.
Runs Smooth and a lot quieter now.

Monday, June 15, 2020

Export tfvc to git.

Several people on the internet say they used git-tfs to export and that it took some manual fixing to get it to look ok, but they never went into detail what that manual fixing was. This is what I did. Git-tfs runs for me at about 6.8 commits/min, at about 5.97 files/commit. That was over a batch of about 300 commits with 1792 file changes which took about 44 minutes. The final result was 27,353 commits (from 8 years of tfvc) and a 550Mb repository. This took about a month having it run in the background, with periodic restarts. It didn't run over weekends, because mandatory restarts would happen "outside work hours", and branch renames needed manual attention (I probably could have scripted it, but I didn't figure out how to find the renames other than looking at deleted branches in source control explorer, or by reviewing the messages output from git-tfs). I used 47 grafts to fix a few history breaks, but mostly renames. If you don't have any renames it will run faster.

Useful gitk views:

Add to .config/git/gitk:
set permviews {{Remote-date {} {--remotes --date-order} {}}
{Remote-Simple-Date {} {--remotes --date-order --simplify-by-decoration} {}}
{{missing authors} {} {--remotes {--author=.*DOMAIN\.tfs.*}} {}}
}
But replace DOMAIN with the actual windows domain of the users (ours was corp, but windows default will be workgroup?

Batches

Your computer will bluescreen at points, IT department will force a mandatory restart, TFS will go down for maintence, your VPN will turn off... 3 times a day, You will miss an author or git-tfs cannot figure out a merge parent, and so you will need to redo a section. Use git tfs fetch -t ######, and copy the resulting git project folder to a safe place. keep a record of which were at what point.

Branches

git-tfs will decide that the main branch ends at 5.6, but it really continues off on branches of branches of branches of 5.6. Sometimes getting the branch to the end will cause the next branch to be initialized automatically due to some merges back into the older branch. But some times it won't.
git tfs branch --init $/Team1-scrum/project/6.0/trunk --no-fetch
--no-fetch followed by fetch -t #### helps with renames and computer troubles.

Merging Broken History

Some one will have moved the code from one project repository, to another by copying the source folder to a new folder. Manually add branch to .git/config
[tfs-remote "default"]
 url = http://tfs:8080/tfs/PrimaryCollection/
 repository = $/Team1/project/1.0/trunk
[tfs-remote "project/2.0/trunk"]
 url = http://tfs:8080/tfs/PrimaryCollection/
 repository = $/Team1/project/2.0/trunk
   ⋮
[tfs-remote "project/5.0/trunk"]
 url = http://tfs:8080/tfs/PrimaryCollection/
 repository = $/Team1-scrum/project/5.0/trunk
then run git-tfs fetch -i project/5.0/trunk then use a graft. see grafts.

Renames

AKA: "warning: this changeset 193940 is a merge changeset. But git-tfs is unable to determine the parent changeset." ugh renames. At some point your supervisor thought that renames were "the bomb", and had the team use them everywhere. Renames break git-tfs. You can set IgnoreBranches=true, but then you get helpful commit messages like "Merge - woops", and no relation to the actual commit with the actual message.
Workaround: Treat it kind of like broken history.
  1. Run git-tfs on the main branch up to the changeset of the rename
    git tfs fetch -i project/6.15/trunk -t 358062
  2. Run git-tfs on the branch up to the rename
    git tfs fetch -i project/6.15/branches/6.15.5 -t 358061
  3. Set initial-changeset and add the branch manually to .git/config,
    [git-tfs]
        workspace-dir = c:\\w1
        ignore-branches = false
        ignore-not-init-branches = false
        ignore-branches-regex = .*(?:branchs|Skies).*
        export-metadatas = true
        disable-gitignore-support = true
        initial-changeset = 358062[tfs-remote "project/6.15/branches/6.15.6"]
        url = http://tfs:8080/tfs/PrimaryCollection/
        repository = $/Team1-scrum/project/6.15.6/trunk
    
  4. Run fetch on the one changeset
    git tfs fetch -i Core/6.15/branches/6.15.6 -t 358062
    (In my case, ~12,000 files took between 1.5-3 hours to get that one changeset. I don't know what it did during that time. The first 40 minutes is downloading the files, then git-tfs was in some "if changset is a rename do stuff for each file" loop. The process sits at 0% cpu, and 0% io for the whole time. I think there might be a problem in one of the libraries it depends on.)
  5. Match up the child/parent hashes with a graftreplacement, and verify that you didn't lose any commits. Ideally the commit should have no changes, but in my case most of the renames also altered version manifest files, or test playlist files, and other things that have version numbers.
  6. Then move on with another git tfs fetch -i project/6.15/trunk -t #####.
This works with renames because renames delete all files in the old branch, and create all files in the new branch, so all the files get fetched. Since fetch only gets the files listed in the changset, this does not work for skipping changesets, unless the next changeset reverts all those changes, etc.

GraftsReplacements

I think that git-tfs might find previous commit id's by saving notes pointing to commit hashes?, so I didn't change the hashes until I was done with git-tfs. (If this isn't the case, you could rebase instead? The way I did it seems to work ok.)(see Addendum, with git-tfs bootstrap. rebases probably would have worked.) I used a graft file, .git/info/grafts, https://git.wiki.kernel.org/index.php/GraftPoint, and then at the end of exporting turned that into replacements. https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-replace.html

Make GraftsReplacements Permanent

Since I'm on windows 10... I download filter-repo, https://github.com/newren/git-filter-repo, saved it in C:\Program Files\Git\mingw64\libexec\git-core\git-filter-repo , changed #!/usr/bin/env python3 to just #!/usr/bin/env python . I used a graft file git replace --convert-graft-file. Then ran git filter-repo --force

Push to Remote

git branch --all will probably show a million branches now. All the ones that start with tfs/ are the git-tfs exported branches. I was at 280. Dump git branch --all somewhere and massage it to look like git checkout -b nice_branch_name tfs/long_path_to_branch_folder. I did something like regex tfs/Core/(.*)/branches/(.*) into git branch -b $2 tfs/Core/$1/branches/$2, then run all of those, git filter-repo --force, and then run git push --set-upstream origin --all

Addendum

I thought I was done. During export the company decided to migrate to Azure Devops. Now all the markers are wrong. try git filter-repo to change urls to work items, git-tfs markers etc.
I can try just putting it all in the command. It is only a few lines. ... could probably one line it pretty easily. It would be a long line... I'll just shift enter for multple lines. Don't forget to escape double quotes.
PS C:\blah> git filter-repo --commit-callback '
>> msg = commit.message.decode(\"utf-8\")
>> newmsg = msg.replace(\"http://tfs:8080/tfs/PrimaryCollection\", \"https://dev.azure.com/Company\")
>> commit.message = newmsg.encode(\"utf-8\")
>> ' --force
Parsed 52227 commits
New history written in 328.30 seconds; now repacking/cleaning...
Repacking your repo and cleaning out old unneeded objects
HEAD is now at 087f91945a blah blah
Enumerating objects: 346091, done.
Counting objects: 100% (346091/346091), done.
Delta compression using up to 8 threads
Compressing objects: 100% (82068/82068), done.
Writing objects: 100% (346091/346091), done.
Total 346091 (delta 259364), reused 346030 (delta 259303), pack-reused 0
Completely finished after 443.37 seconds.
PS C:\blah> git tfs fetch -i Team1/project/7.15/trunk | tee-object -append -filepath .\.git\git-tfs_output.txt
Fetching from TFS remote 'Team1/project/7.15/trunk'...
C517459 = 22479e47965497a6ef463561fd9bba7e0eec2721

C517495 = a1d489d549619fa7aba9c75eaddbedf71e57e0b0
C517496 = 121904adb55dd14748b8fd5212eb1c1ad485734a
C517497 = c5ff0cd4f9f601356e7e3357716545354096a992
C517523 = ba60e45569c1a31b0574ecea4b7aec59e613d35e
C517544 = c15456e36f48d0bddf9c48b1d236ce6381ea598a
C517547 = 7549153a8c17138dcf6a9057151c61670685749c
C517590 = 0b428c7b897c9a5ea6195ea97434defdceaa2d31
C517611 = 9e395115d83fd0d2170f249ec8e0b4b596a55f85
C517613 = fb68cf3aea8741b2ff3a90eabcc58fe2233b2275
C517633 = 5f120b9d7d8e33a2f4bad39d0eb2480cc8db516a
C517778 = 411b5a02ec104ec485dd6d7a0e8464d28b7701ce
C517877 = 55f0f4ac3776a3ddb445d32584da25dacf107ad1
C517882 = e9221fc672238cbade656c3079c3683c800f45c5
C517884 = 1069db9ef920f610589a8a0d44e50993196bfa5e
PS C:\blah> gitk --date-order --remotes
PS C:\blah>
phew.
Don't use --refs HEAD, or it won't get all the branches. I used --force because I didn't want to bother pushing/cloning/pushing.

Addendum-Addendum

Trying to get more changes sets from ADO:

Azure DevOps Services

WARNING - ACTION RECOMMENDED

Your requests are being delayed.
On 6/22/2020 at 5:48 PM (UTC) we detected that your resource consumption on https://dev.azure.com/Company/ exceeded one of our limits. To maintain service availability for other users, we began delaying some of your requests. Your requests will continue being delayed until your resource consumption returns below our limits.
You can audit your request history by visiting the usage page for your organization. Please visit our documentation to learn more.

documentation

personal usage exceeds 200 times the consumption of a typical user within a (sliding) five-minute window.
Delays range from a few milliseconds per request up to 30 seconds. Once consumption goes to zero or the resource is no longer overwhelmed, the delays will stop within five minutes.
This is going to take forever... Maybe I need to run fetches in batches of 5 minutes. ... Checking how long this batch of 2148 commits took. 20 minutes for inital commit, 23 minutes for ~550 commits until throttling email, 45 minutes for ~1600 commits after throttling email. so 23.9 commits/min before, then 35.6 commits/min after. So it was faster after I got the email saying it was throttling. Either way ADO docker server is faster than our our old on prem i-don't-know-what-it-was server.

Branch-DeleteBranch-Rename

  1. Branching 3.5.3 From $/Team1/Project/3.5
  2. Updated some version files
  3. Whoops, deleting, shouldn't have branched
  4. renaming 3.5.2 to 3.5.3
yay.

PS C:\project> git filter-repo --commit-callback '
>> msg = commit.message.decode(\"utf-8\")
>> newmsg = msg.replace(\"3.5.3;C1515\", \"3.5.3_deleted;1515\")
>> commit.message = newmsg.encode(\"utf-8\")
>> ' --force
Parsed 14574 commits
New history written in 35.78 seconds; now repacking/cleaning...
Repacking your repo and cleaning out old unneeded objects
HEAD is now at 4bcefff9c Branched from $/Team1/Project/3.7/trunk
Enumerating objects: 102957, done.
Counting objects: 100% (102957/102957), done.
Delta compression using up to 8 threads
Compressing objects: 100% (27802/27802), done.
Writing objects: 100% (102957/102957), done.
Total 102957 (delta 73787), reused 102953 (delta 73786), pack-reused 0
Completely finished after 42.71 seconds.
PS C:\project>
Also, delete the tfs remote ref from .git/refs/remotes/tfs/..., or since you just ran git filter repo, it probably got packed into .git/packed-refs. Just open the file in a text editor and delete the one line with "refs/remotes/tfs/Team1/Project/3.5.3". (For some reason git branch -d -r tfs/Team1/Project/3.5.3 deleted more than just that one ref... maybe it will work for you though.) Then do the steps in "Renames". (set initial-commit in .git/config...

PS C:\project> git tfs fetch -i Team1/Projects/branches/3.5.3 -t 15161 | tee-object -append -filepath .\.git\git-tfs_output.txt
Fetching from TFS remote 'Loyalty3X/Core/3.12/branches/3.12.3'...
C15161 = a7a9a025f8ecbf26d93387a2727dab9aedfacd5c

PS C:\project> git replace --graft a7a9a025f8ecbf26d93387a2727dab9aedfacd5c bd33b9f18c91070c64797d38fe98aebb894832f3
PS C:\project>
)

Branch - DeleteBranch - reBranch

Try moving the remote ref to the new branch parent, by editing refs/remotes/tfs/.../branch, setting initial-commit to newbranchChangeset in .git/config like in the rename scenario, and running git tfs fetch -i branch -t newbranchChangeset

Sources:

Friday, November 15, 2019

Linux Mint 19 Ldap login

"Implementing LDAP on Linux isn’t exactly difficult once you know the right changes to make. For reasons I cannot explain, however, most information I have read about LDAP seems to convey just how much trouble the author had implementing it. Finding the right changes in the first place is usually the most challenging part. Linux distributions could automate this process a little more; having front ends to server and client configuration would take Linux far in the LDAP world."
-- https://www.linux.com/news/linux-ldap-authentication/ 2005

"
   ROFL:ROFL:ROFL:ROFL
      ___^___ _
 L    __/      [] \    
LOL===__           \ 
 L      \___ ___ ___]
            I   I
         ----------/
"
-- Me (2019)

Do:

sudo apt install ldap-utils libpam-ldapd libnss-ldapd nscd libpam-mklocaluser

/etc/nsswitch.conf (I think I had to put "ldap" on the three lines.)

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         ldap compat systemd
group:          ldap compat systemd
shadow:         ldap compat
gshadow:        files

hosts:          files mdns4_minimal [NOTFOUND=return] dns myhostname
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

/etc/ldap.conf(just the uncommented lines)

host diskstation.lan
base dc=lan
ldap_version 3
rootbinddn uid=admin,cn=users,dc=lan
pam_password md5
Don't need to modify:
/etc/pam.d/common-account 
/etc/pam.d/common-auth 
/etc/pam.d/common-password 

finally

sudo /etc/init.d/nscd restart

Gotchas

Don't forget to restart nscd/nslcd services

Make sure the local user (the one used to setup the machine) and the ldap user's UID/GID match. Default Linux first setup user is UID=1000/GID=1000; default LDAP is UID=1000001/GID=1000001. When LDAP login takes over, the LDAP numbers start working, and permissions don't work anymore, since 1000=/=1000001. The names listed are correct in all ls -l commands, so it gets hard to track down. Use id instead. I changed my ldap UID/GUID to 1000, because I didn't want to change the local one with every new computer setup. I guess I could have a real admin account on the machines...

ldapsearch doesn't use /etc/ldap.conf, so it isn't helpful verifying the files.

Example LDAPSEARCH to see everything:


stephen@compy~$ ldapsearch -h diskstation.lan -x -b "dc=lan"
# extended LDIF
#
# LDAPv3
# base <dc=lan> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
# 

...

also jexplorer for gui-ness


tail /var/log/auth.log:

"failed to bind to LDAP server ldapi:///diskstation.lan: Can't contact LDAP server"
doesn't mean the url is wrong. Use "host diskstation.lan" not "uri ldapi:///diskstation.lan"

"failed to bind to LDAP server ldap://diskstation.lan: Invalid credentials"
Doesn't mean the password is wrong, rootbinddn might be wrong. It needs a "uid" and a "cn" and a "dc"

/etc/ldap.conf

host diskstation.lan

rootbinddn uid=admin,cn=users,dc=lan

libnss-ldapd,libpam-ldapd

don't forget the 'd'. https://askubuntu.com/questions/458400/ldap-client-causes-boot-to-be-very-slow-on-13-10-causes-hang-on-14-04

TODO:

credential caching for offline-ness.

Friday, May 4, 2018

Syma x5hw video stream

Appears to be the same as "syma x5"

http://192.168.1.1/videostream.cgi?user=admin&pwd=

it lags a bit even after setting :network-caching to 0.

source:
https://www.reddit.com/r/fpv/comments/443crq/syma_x5_video_stream_url/