https://www.marcelpost.com/wiki/index.php?title=Special:NewPages&feed=atom&hideredirs=1&limit=50&offset=&namespace=0&username=&tagfilter=&size-mode=max&size=0wikipost - New pages [en-gb]2024-03-29T10:13:57ZFrom wikipostMediaWiki 1.39.5https://www.marcelpost.com/wiki/index.php/Csv-iterationCsv-iteration2024-02-25T05:10:39Z<p>Admin: </p>
<hr />
<div><br />
<br />
<pre><br />
#!/bin/sh<br />
<br />
# process a comma-separated list of values<br />
<br />
ITEMLIST="apples,pears"<br />
ITEMCOUNT=1<br />
<br />
while true<br />
do<br />
ARGCNT="$"<br />
ARGCNT=$ARGCNT$ITEMCOUNT<br />
<br />
ITEMNAME=`echo $ITEMLIST | awk -F \, "{print $ARGCNT}"`<br />
<br />
if test -z "$ITEMNAME"<br />
then<br />
ITEMCOUNT=$((ITEMCOUNT - 1))<br />
break<br />
else<br />
# item name found, do something with it<br />
echo "Item $ITEMCOUNT = $ITEMNAME"<br />
<br />
fi<br />
<br />
ITEMCOUNT=$((ITEMCOUNT + 1))<br />
<br />
done<br />
</pre></div>Adminhttps://www.marcelpost.com/wiki/index.php/Bash-examplesBash-examples2024-02-25T05:10:10Z<p>Admin: Created page with "Collection of somewhat useful scrips I found that do things in bash. csv-iteration"</p>
<hr />
<div>Collection of somewhat useful scrips I found that do things in bash.<br />
<br />
[[csv-iteration]]</div>Adminhttps://www.marcelpost.com/wiki/index.php/What_are_the_chancesWhat are the chances2024-02-24T07:07:04Z<p>Admin: </p>
<hr />
<div>[[File:What are the chances.jpg]]</div>Adminhttps://www.marcelpost.com/wiki/index.php/Setting_global_variablesSetting global variables2024-02-13T22:44:49Z<p>Admin: </p>
<hr />
<div><br />
<br />
<br />
===Global User Name===<br />
Get the current global user name:<br />
<pre><br />
git config --global user.name<br />
</pre><br />
<br />
<br />
Set the current global user name:<br />
<pre><br />
git config --global user.name "Joe Bloggs"<br />
</pre><br />
<br />
<br />
===Global User Email address===<br />
Get the current global user email address:<br />
<pre><br />
git config --global user.email<br />
</pre><br />
<br />
<br />
Set the current global user email address:<br />
<pre><br />
git config --global user.name "joe@bloggs.com"<br />
</pre></div>Adminhttps://www.marcelpost.com/wiki/index.php/BranchesBranches2024-02-09T01:45:29Z<p>Admin: </p>
<hr />
<div><br />
===Git branch model===<br />
<br />
<br />
- develop<br />
<br />
- feature<br />
<br />
- release<br />
<br />
- master<br />
<br />
<br />
Some basic rules for successful development using branches:<br />
<br />
- master only gets updated from release<br />
<br />
- develop is the main working branch<br />
<br />
- develop is the source for new releases and features<br />
<br />
- features can only go back into develop<br />
<br />
<br />
resource: https://nvie.com/posts/a-successful-git-branching-model/<br />
<br />
<br />
<br />
==Create a new development branch from master==<br />
<br />
<pre><br />
git branch develop<br />
git push --set-upstream origin develop<br />
</pre><br />
<br />
<br />
==Develop code==<br />
<br />
The develop branch is used for continuous code development and for working out conflicts when merging features that were on a separate branch. Only when the code is functional enough can it be considered as a release candidate (see Releases below).<br />
<br />
===Set up develop environment===<br />
When developing code for a website, it may be wise to clone the project into a new folder so as not to mess with the live/production 'master' environment<br />
<pre><br />
git clone git@gitserver:myproject myproj_dev<br />
cd myproj_dev<br />
git checkout develop<br />
</pre><br />
<br />
If the development branch and work environment has already been created, then simply checkout the code:<br />
<br />
<pre><br />
cd myproject_dev<br />
git checkout develop<br />
</pre><br />
<br />
It may be useful to have a text file BUGS to let the developers know what work is still outstanding.<br />
<br />
A text file CHANGES might be useful for the end-user to quickly see which new features or bug fixes have been incorporated.<br />
<br />
<br />
===Commit code===<br />
After you have developed your code and completed some logical component it is wise to commit the changes to the repository to make it easier for future code revision and debugging.<br />
<pre><br />
git add .<br />
git commit -m <commit message><br />
</pre><br />
<br />
<br />
===Upload commit to server===<br />
When a remote repository is available it is good practice to also upload the latest commit so everyone else can get access to the most recent changes in code.<br />
<pre><br />
git push<br />
</pre><br />
<br />
<br />
==Releases==<br />
When the code in the develop branch is functional and without major bugs it can be considered as a release candidate. Code in the release branch can still contain bugs, but it's intended to fix only the current bugs and not introduce new features. Once the release has been thoroughly tested and all known bugs are squashed it can be brought over to the main branch (see Stable branch below).<br />
<br />
<br />
===Create Release branch===<br />
If not done so already, create a new Release branch from develop.<br />
<br />
<pre><br />
git branch release<br />
git push --set-upstream origin release<br />
</pre><br />
<br />
If the release branch has already been created, then simply checkout the release branch<br />
<pre><br />
git checkout release<br />
</pre><br />
<br />
Develop your code and commit as per normal.<br />
<br />
It may be useful to create a text file RELEASE_VERSION to let the developers know what this release is for.<br />
<br />
<br />
==Stable==<br />
When finishing touches on the release branch have completed it's time to merge the code of the release branch into the master branch. The master branch is where only stable code releases should live. This keeps the branch clean from development work and commit comments.<br />
<br />
<pre><br />
git checkout master<br />
git pull origin master<br />
git merge release<br />
git push origin master<br />
</pre><br />
<br />
If the 'release' branch is not yet known to the master branch, you can bring the local git up to date with what's on the server with the fetch command:<br />
<pre><br />
git fetch<br />
</pre><br />
<br />
Do not merge from release again until the version in release is ready to be called stable.<br />
<br />
Next, go to the development environment and open the release branch and rev up the RELEASE_VERSION to what the next stable version number should be.</div>Adminhttps://www.marcelpost.com/wiki/index.php/Bash_git-promptBash git-prompt2024-02-09T01:42:27Z<p>Admin: </p>
<hr />
<div><br />
automatically change the prompt when you're in a git directory<br />
<br />
<pre><br />
---[~/.bashrc]---<br />
# uncomment these 5 lines to automatically show a different PS1 prompt when you enter a git directory<br />
GIT_PS1_SHOWDIRTYSTATE=1<br />
GIT_PS1_SHOWUNTRACKEDFILES=1<br />
GIT_PS1_SHOWCOLORHINTS=true<br />
PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'<br />
source /usr/lib/git-core/git-sh-prompt<br />
---[]---<br />
</pre></div>Adminhttps://www.marcelpost.com/wiki/index.php/Setting_aliasesSetting aliases2024-02-09T01:36:47Z<p>Admin: Created page with " <pre> creating an alias will probably save you a lot of time typing in long commands to create an alias either create one from the commandline or edit ~/.gitconfig on the commandline: git config --global alias.hist 'log --graph --all --oneline' NOTE: omitting '--global' will only set this alias for this repository editing the config file: --- [alias] hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --all --oneline --date=short --- or..."</p>
<hr />
<div><br />
<br />
<pre><br />
creating an alias will probably save you a lot of time typing in long commands<br />
<br />
to create an alias either create one from the commandline or edit ~/.gitconfig<br />
<br />
on the commandline:<br />
<br />
git config --global alias.hist 'log --graph --all --oneline'<br />
<br />
NOTE: omitting '--global' will only set this alias for this repository<br />
<br />
<br />
editing the config file:<br />
<br />
---<br />
[alias]<br />
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --all --oneline --date=short<br />
<br />
---<br />
<br />
<br />
or setting it from the command line:<br />
<br />
git config --global alias.hist 'log --graph --all --oneline --pretty=format:"%h%x09%an%x09%ad%x09%s" --date=relative --abbrev-commit --decorate'<br />
<br />
<br />
<br />
</pre></div>Adminhttps://www.marcelpost.com/wiki/index.php/Creating_a_git_repository_from_an_existing_projectCreating a git repository from an existing project2024-02-09T01:34:59Z<p>Admin: </p>
<hr />
<div><br />
<br />
Assuming a project in ~/myproject containing all sorts of files and directories<br />
<br />
<br />
<pre><br />
In the below example we use a local project called 'myproject' and upload it to the git server.<br />
<br />
- if the existing local 'myproject' isn't initialised with git yet, then do so now:<br />
$ git init<br />
$ git add .<br />
$ git commit -m "initial commit"<br />
<br />
<br />
- clone 'myproject' from your local project into a new local directory called 'myproject.git'<br />
<br />
$ git clone --bare myproject/ myproject.git<br />
<br />
<br />
- upload the new repository to the remote server<br />
<br />
$ scp -r myproject.git/ git@gitserver:/home/git<br />
<br />
(this will create the folder /home/git/myproject.git on the server)<br />
<br />
<br />
you may now clone the repository directly from the server into a local folder<br />
<br />
$ cd somedir<br />
$ git clone git@gitserver:myproject (the .git extension is not required)<br />
<br />
lastly, you may now remove the original 'myproject' dir locally<br />
<br />
</pre></div>Adminhttps://www.marcelpost.com/wiki/index.php/GitGit2024-02-09T01:21:21Z<p>Admin: </p>
<hr />
<div><br />
[[Creating a git repository from an existing project]]<br />
<br />
[[setting aliases]]<br />
<br />
[[setting global variables]]<br />
<br />
[[bash git-prompt]]<br />
<br />
[[branches]]</div>Adminhttps://www.marcelpost.com/wiki/index.php/VncVnc2024-02-09T01:18:57Z<p>Admin: Created page with "enabling a VNC server for remote desktop access using x11vnc <pre> apt-get install x11vnc </pre>"</p>
<hr />
<div>enabling a VNC server for remote desktop access<br />
<br />
<br />
using x11vnc<br />
<pre><br />
apt-get install x11vnc<br />
<br />
</pre></div>Adminhttps://www.marcelpost.com/wiki/index.php/Systemd-tipsSystemd-tips2024-02-09T01:17:14Z<p>Admin: /* Enable /etc/rc.local= */</p>
<hr />
<div><br />
<br />
<br />
<br />
===Enable /etc/rc.local===<br />
<br />
<pre><br />
--[example /etc.rc.local]--<br />
#!/bin/sh -e <br />
# <br />
# rc.local <br />
# <br />
# This script is executed at the end of each multiuser runlevel. <br />
# Make sure that the script will "exit 0" on success or any other <br />
# value on error. <br />
# <br />
# In order to enable or disable this script just change the execution <br />
# bits. <br />
# <br />
# By default this script does nothing. <br />
<br />
exit 0<br />
--[end]-- <br />
<br />
systemctl daemon-reload<br />
<br />
systemctl start rc-local<br />
</pre></div>Adminhttps://www.marcelpost.com/wiki/index.php/Vim-configVim-config2024-02-09T01:15:00Z<p>Admin: Created page with " useful entries in ~/.vimrc <pre> " --- disable syntax highlighting syntax off " --- open file at last edit position autocmd BufReadPost * \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit' \ | exe "normal! g`\"" \ | endif " --- disable bell and screen flickering on escape --- set visualbell set t_vb= " -- allow mouse copy and paste -- set mouse=r " --- set tabstops to 4 spaces and set shiftwidth (ident amount) as..."</p>
<hr />
<div><br />
<br />
useful entries in ~/.vimrc<br />
<br />
<pre><br />
<br />
" --- disable syntax highlighting<br />
<br />
syntax off<br />
<br />
<br />
<br />
" --- open file at last edit position<br />
<br />
autocmd BufReadPost *<br />
\ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'<br />
\ | exe "normal! g`\""<br />
\ | endif<br />
<br />
<br />
" --- disable bell and screen flickering on escape ---<br />
set visualbell<br />
set t_vb=<br />
<br />
<br />
" -- allow mouse copy and paste --<br />
set mouse=r<br />
<br />
<br />
<br />
" --- set tabstops to 4 spaces and set shiftwidth (ident amount) as 4 spaces to match tabstops ---<br />
set ts=4 sw=4<br />
<br />
" --- redefine tab as spaces ---<br />
set expandtab<br />
<br />
<pre></div>Adminhttps://www.marcelpost.com/wiki/index.php/MorseRunnerMorseRunner2024-02-04T08:51:47Z<p>Admin: </p>
<hr />
<div>An excellent morse-code CW Contest Simulator is a program created by Alex Shovkoplyas (VE3NEA) called MorseRunner.<br />
<br />
After you set your own callsign and the speed at which you want to send CW you're set to go. I normally set a duration for 15 minutes and then click on the green Run button to kick it off.<br />
<br />
The software is surprisingly good at realistically simulating various types of contacts; some slow, some fast, sometimes fading, with crackles and pops in the background.<br />
<br />
<br />
Below are a few hints to help me better understand how the program works.<br />
<br />
<br />
F1 - sends your callsign to initiate making new contacts<br />
<br />
The outgoing format is always CQ <YOURCALL> TEST<br />
<br />
When a contact sends their call, it is usually in one of these formats:<br />
<br />
<THEIRCALL><br />
DE <THEIRCALL><br />
<THEIRCALL> <THEIRCALL><br />
<br />
<br />
simply enter it in the 'Call' field and press ENTER. The software will then send:<br />
<br />
<THEIRCALL> 599 <NR><br />
<br />
where <NR> is your sequential contact number (001, 002, etc..)<br />
<br />
After this, the contact can respond in several ways<br />
<br />
<br />
- R <THEIRCALL> acknowledged (roger) of your numbers, after which they'll send their SNR and NR<br />
<br />
- ? [..--..] not heard correctly, please send again. Press F2 to re-send my number again<br />
<br />
<br />
<br />
Incoming contact formats:<br />
<THEIRCALL> 599 <NR><br />
<br />
where <NR> can be:<br />
- normal digits (e.g. 001)<br />
- replacing a zero with a T (e.g. TT4)<br />
<br />
<br />
If you get their contest serial number wrong it will show as NR in the list of contacts.<br />
<br />
<br />
TIPS:<br />
- don't wait too long after the contact's call to send your <br />
<br />
Sometimes contacts will prefix their callsign with 'DE', so make sure to listen carefully<br />
<br />
<br />
<br />
Resources:<br />
<br />
https://www.dxatlas.com/MorseRunner/<br />
<br />
https://github.com/VE3NEA/MorseRunner</div>Admin