Script to install
segunda-feira, julho 29, 2024
Ubiquiti UniFi Installation Scripts | UniFi Easy Update Script
sexta-feira, março 29, 2024
PfSense update error ERROR: It was not possible to determine pkg remote version
Error updating pfsense from console, error:
Enter an option: 13
ERROR: It was not possible to determine pkg remote version
>>> Updating repositories metadata...
Updating pfSense-core repository catalogue...
pkg-static: An error occured while fetching package
pkg-static: An error occured while fetching package
repository pfSense-core has no meta file, using default settings
pkg-static: An error occured while fetching package
pkg-static: An error occured while fetching package
Unable to update repository pfSense-core
Updating pfSense repository catalogue...
pkg-static: An error occured while fetching package
pkg-static: An error occured while fetching package
repository pfSense has no meta file, using default settings
pkg-static: An error occured while fetching package
pkg-static: An error occured while fetching package
Unable to update repository pfSense
Error updating repositories!
ERROR: It was not possible to determine pfSense-upgrade remote version
ERROR: It was not possible to determine pfSense-upgrade remote version
>>> Upgrading pfSense-upgrade... failed.
$ pfSense-upgrade -c
ERROR: It was not possible to determine pkg remote version
>>> Updating repositories metadata... failed.
ERROR: It was not possible to determine pfSense remote version
ERROR: It was not possible to determine pfSense-base remote version
ERROR: It was not possible to determine pfSense-kernel-pfSense remote version
$ pkg-static clean -ay ; pkg-static install -fy pkg pfSense-repo pfSense-upgrade
pkg-static: Repository pfSense-core missing. 'pkg update' required
pkg-static: No package database installed. Nothing to do!
Updating pfSense-core repository catalogue...
pkg-static: An error occured while fetching package
pkg-static: An error occured while fetching package
repository pfSense-core has no meta file, using default settings
pkg-static: An error occured while fetching package
pkg-static: An error occured while fetching package
Unable to update repository pfSense-core
Updating pfSense repository catalogue...
pkg-static: An error occured while fetching package
pkg-static: An error occured while fetching package
repository pfSense has no meta file, using default settings
pkg-static: An error occured while fetching package
pkg-static: An error occured while fetching package
Unable to update repository pfSense
Error updating repositories!
$ pkg-static -d update
Sample output:
DBG(1)[31490]> pkg initialized
Updating pfSense-core repository catalogue...
DBG(1)[31490]> PkgRepo: verifying update for pfSense-core
DBG(1)[31490]> PkgRepo: need forced update of pfSense-core
DBG(1)[31490]> Pkgrepo, begin update of '/var/db/pkg/repo-pfSense-core.sqlite'
DBG(1)[31490]> Request to fetch pkg+https://pkg.pfsense.org/pfSense_v2_7_2_amd64-core/meta.conf
DBG(1)[31490]> curl_open
DBG(1)[31490]> Fetch: fetcher used: pkg+https
DBG(1)[31490]> curl> fetching https://pkg.pfsense.org/pfSense_v2_7_2_amd64-core/meta.conf
DBG(1)[31490]> CURL> attempting to fetch from , left retry 3
* Couldn't find host pkg00-atx.netgate.com in the .netrc file; using defaults
* Trying 208.123.73.207:443...
* Connected to pkg00-atx.netgate.com (208.123.73.207) port 443
* ALPN: curl offers http/1.1
* CAfile: none
* CApath: /etc/ssl/certs/
* SSL certificate problem: self-signed certificate in certificate chain
* Closing connection
DBG(1)[31490]> CURL> attempting to fetch from , left retry 2
* Couldn't find host pkg01-atx.netgate.com in the .netrc file; using defaults
* Trying 208.123.73.209:443...
* Connected to pkg01-atx.netgate.com (208.123.73.209) port 443
* ALPN: curl offers http/1.1
* CAfile: none
* CApath: /etc/ssl/certs/
* SSL certificate problem: self-signed certificate in certificate chain
* Closing connection
DBG(1)[31490]> CURL> attempting to fetch from , left retry 1
$ pkg-static -d updatecertctl rehash
$ certctl rehash
Will update certificates.
run:
$ pkg-static upgrade -f pfSense-repoc
Ignore the mismatch and continue? [y/N]: y
rerun update from console.
terça-feira, junho 27, 2023
Powershell Microsoft.PowerShell_profile.ps1 is not digitally signed
PowerShell running .ps1 files not signed and remote
. : File c:\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded. The file C:\Users\xxx\\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.At line:1 char:3
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Fix:
Unblock-File -Path 'C:\Users\xxx\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'
quinta-feira, abril 06, 2023
Remove anydesk printer driver from windows 11
Open CMD with Admin privilegies
Run
pnputil.exe /delete-driver c:\Windows\System32\DriverStore\FileRepository\anydeskprintdriver.inf_amd64_07b22d0a6997cb3a\anydeskprintdriver.inf /uninstall
Or find your .inf folder.
Reference
quinta-feira, novembro 03, 2022
React example with Yarn
https://codefresh.io/docs/docs/learn-by-example/nodejs/react/
React example with Yarn
Create Docker images for React applications
Codefresh can work with React projects as with any Node.js project.
You can see the example project at https://github.com/codefresh-contrib/react-sample-app. The repository contains a React starter project with the following tasks:
yarn testruns unit tests.yarn startto start the application locally.yarn buildto create a production deployment.
Once launched the application presents a simple page at localhost:3000.
The easiest way to build a React.JS application is with multi-stage builds. With multi-stage builds a Docker build can use one base image for packaging/unit tests and a different one that will hold the runtime of the application. This makes the final image more secure and smaller in size (as it does not contain any development/debugging tools).
In the case of React, you can use a base image that has Node and all testing utilities, while the final image has your server (e.g. nginx) with the static content and nothing else.
The example project is actually using multi-stage builds by default.
Here is the multi-stage Dockerfile:
Dockerfile
FROM node:8.16 as build-deps
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn
COPY . ./
RUN yarn build
FROM nginx:1.12-alpine
COPY --from=build-deps /usr/src/app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]This docker build does the following:
- Starts from the Node/Yarn image
- Copies the dependencies inside the container
- Copies the source code and creates all static files
- Discards the Node.js image with all the JavaScript libraries
- Starts again from the nginx image and copies static build result created before
The resulting is very small, as it contains only packaged/minified files.
Creating a CI/CD pipeline for React is very easy, because Codefresh can run any node image that you wish.
Here is the full pipeline that creates the Docker image after checking out the code.
codefresh.yml
version: '1.0'
stages:
- prepare
- test
- build
steps:
main_clone:
title: Cloning main repository...
stage: prepare
type: git-clone
repo: 'codefresh-contrib/react-sample-app'
revision: master
git: github
MyUnitTests:
title: Unit test
stage: test
image: node:8.16
commands:
- yarn install
- yarn test
environment:
- CI=true
MyAppDockerImage:
title: Building Docker Image
type: build
stage: build
image_name: react-sample-app
working_directory: ./
tag: 'with-nginx'
dockerfile: DockerfileThis pipeline clones the source code, runs unit tests and finally creates a Docker image. Codefresh is automatically caching Docker layers (it uses the Docker image of a previous build as a cache for the next) and therefore builds will become much faster after the first one finishes.
If your application is not dockerized yet, you can still create a pipeline that runs any command that you would run locally. You can also choose which Node version is used for each step of the pipeline by defining a different docker image for each step.
Here is the full pipeline that creates a production deployment of all files.
codefresh.yml
version: '1.0'
stages:
- prepare
- test
- build
steps:
main_clone:
title: Cloning main repository...
stage: prepare
type: git-clone
repo: 'codefresh-contrib/react-sample-app'
revision: master
git: github
MyUnitTests:
title: Unit test
stage: test
image: node:11.0
commands:
- yarn install
- yarn test
environment:
- CI=true
MyReactBuild:
title: Packaging application
stage: build
image: node:8.16
commands:
- yarn buildNotice that for demonstration purposes we uses node 11 for the tests, and node 8 for the packaging. Normally you should use the same version of node/Yarn for all your steps, but Codefresh pipelines are flexible on version of tools.
Even when you don’t create a Docker image, Codefresh still caches your workspace volume. This means that node_modules are downloaded only once. All subsequent builds will be much faster.

